package com.tjtt.gwm.action;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.struts2.ServletActionContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.tjtt.common.utils.TotalFlowXmlTool;
import com.tjtt.gwm.bean.Junyans;
import com.tjtt.gwm.bean.Junyansceshis;
import com.tjtt.gwm.bean.Junyansshejis;
import com.tjtt.gwm.service.DbService;
import com.tjtt.gwm.service.EquipmentService;

import com.tjtt.gwm.service.JunyansService;
import com.tjtt.gwm.service.PipePointService;
import com.tjtt.tdm.base.BaseAction;
import com.tjtt.tdm.base.PageResult;
import com.tjtt.tdm.base.StringUtil;
import com.tjtt.tdm.codeReview.service.ICodeReviewService;
import com.tjtt.tdm.flow.bean.FlowDetailed;
import com.tjtt.tdm.flow.service.IFlowformService;
import com.tjtt.tdm.form.bean.AutoFormsNew;
import com.tjtt.tdm.util.PubMethod;
import com.tjtt.tdm.util.WordTool;

public class PipePointAction extends BaseAction {
	private PipePointService pipePointService;
	private DbService dbService;
	private List<Object[]> pipeSecStructList; 	 //管段数组
	private List<Object[]> pipeSecStructListTee; //含三叉点的管段数组
	private List<List<Object[]>> pipeSecStructListSorted; 
	private List<Object[]> pipeLineNodeList;
	int m_num3;
	int m_num1;
	int m_num2;
	public DbService getDbService() {
		return dbService;
	}
	public void setDbService(DbService dbService) {
		this.dbService = dbService;
	}
	
	public PipePointService getPipePointService() {
		return pipePointService;
	}
	public void queryRiskEvaluate()
	{
		try {			
			Map<String, String> filterMap = getPagerMap();			
			String[] viewArray = { "ID", "FIELDNAME","FIELDVALUE","FIELDUNIT"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRiskEvaluate(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public void queryRiskRes()
	{
		try {			
			Map<String, String> filterMap = getPagerMap();			
			String[] viewArray = { "ID", "FIELDNAME","FIELDVALUE","FIELDRES"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRiskRes(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public void queryRiskWeight()
	{
		try {			
			Map<String, String> filterMap = getPagerMap();			
			String[] viewArray = { "ID", "FIELDNAME","FIELDVALUE","FIELDALL"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRiskWeight(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public void queryRiskS()
	{
		try {			
			Map<String, String> filterMap = getPagerMap();			
			String[] viewArray = { "ID", "NO","EVALUATEITEM","EVALUATECONTENT","EVALUETESCORE","SCORE"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRiskS(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public void queryRiskC()
	{
		try {			
			Map<String, String> filterMap = getPagerMap();			
			String[] viewArray = { "ID", "NO","EVALUATEITEM","EVALUATECONTENT","EVALUETESCORE","SCORE"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRiskC(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//查询日期查询条件列表
	public void queryDateSearch()
	{
		String strSearchName=getRequest().getParameter("searchname");
		try {			
			Map<String, String> filterMap = getPagerMap();			
			//将查询条件保存到Map里
			filterMap.put("strSearchName", strSearchName);
			String[] viewArray = { "ID", "QUERY_FIELD","QUERY_TABLE",
					"CONNECT_TABLE","CONNECT_FIELD","CONNECT_FIELD_CON",
					"CONDITION_FIELD_EN","CONDITION_FIELD_CN",
					"CONDITION_TABLE","MAIN_FIELD","FOREIGN_FIELD","OWNER"};
			// 查询所有的数据
			PageResult result = pipePointService.queryDateSearch(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	//查询区间查询条件列表
	public void queryRangeSearch()
	{
		String strSearchName=getRequest().getParameter("searchname");
		try {			
			Map<String, String> filterMap = getPagerMap();			
			//将查询条件保存到Map里
			filterMap.put("strSearchName", strSearchName);
			String[] viewArray = { "ID", "QUERY_FIELD","QUERY_TABLE",
					"CONDITION_FIELD_EN","CONDITION_FIELD_CN",
					"CONDITION_TABLE","MAIN_FIELD","FOREIGN_FIELD","OWNER"};
			// 查询所有的数据
			PageResult result = pipePointService.queryRangeSearch(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	//查询选择查询条件列表
	public void querySelectSearch()
	{
		String strSearchName=getRequest().getParameter("searchname");
		try {			
			Map<String, String> filterMap = getPagerMap();			
			//将查询条件保存到Map里
			filterMap.put("strSearchName", strSearchName);
			String[] viewArray = { "ID", "QUERY_FIELD","QUERY_TABLE",
					"CONNECT_TABLE","CONNECT_FIELD","CONNECT_FIELD_CON",
					"DICTIONARY_TABLE",
					"CONDITION_FIELD_EN","CONDITION_FIELD_CN",
					"CONDITION_TABLE","CONDITION_TABLE_CN","MAIN_FIELD",
					"FOREIGN_FIELD","OWNER"};
			// 查询所有的数据
			PageResult result = pipePointService.querySelectSearch(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	//查询关键字查询条件列表
	public void queryKeywordSearch()
	{
		String strSearchName=getRequest().getParameter("searchname");
		try {			
			Map<String, String> filterMap = getPagerMap();			
			//将查询条件保存到Map里
			filterMap.put("strSearchName", strSearchName);
			String[] viewArray = { "ID", "QUERY_FIELD","QUERY_TABLE",
					"CONDITION_FIELD_EN","CONDITION_FIELD_CN",
					"CONDITION_TABLE","MAIN_FIELD","FOREIGN_FIELD","OWNER"};
			// 查询所有的数据
			PageResult result = pipePointService.queryKeywordSearch(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			//System.out.println("--!"+returnStr+"--!");
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	public void updateKeywordSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			//"',to_date('"+time+"','yyyy-MM-dd HH24:mi:ss'))";
			String QUERY_FIELD=getRequest().getParameter("queryField");
			String QUERY_TABLE=getRequest().getParameter("queryTable");
			String CONDITION_FIELD_EN=getRequest().getParameter("conditionField");
			String CONDITION_FIELD_CN=getRequest().getParameter("conditionFieldCn");
			String CONDITION_TABLE=getRequest().getParameter("conditionTable");
			String MAIN_FIELD=getRequest().getParameter("conditionMain");
			String FOREIGN_FIELD=getRequest().getParameter("queryForeign");
			String OWNER=getRequest().getParameter("owner");
			String autoFormId = getRequest().getParameter("autoFormId");
			
			String sql="update PTEM_SEARCH_KEYWORD set QUERY_FIELD='"+QUERY_FIELD
			+"',QUERY_TABLE='"+QUERY_TABLE+"',CONDITION_FIELD_EN='"+CONDITION_FIELD_EN
			+"',CONDITION_FIELD_CN='"+CONDITION_FIELD_CN+
			"',CONDITION_TABLE='"+CONDITION_TABLE+
			"',MAIN_FIELD='"+MAIN_FIELD+
			"',FOREIGN_FIELD='"+FOREIGN_FIELD+
			"',OWNER='"+OWNER+
			"' where id='"+autoFormId+"'";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
			//return ERROR;
		}
	}
	public void updateAutoSearchByID() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			//"',to_date('"+time+"','yyyy-MM-dd HH24:mi:ss'))";
			
			String autoFormId = getRequest().getParameter("autoFormId");
			String search_name_en=getRequest().getParameter("formEnName");
			String search_name_cn=getRequest().getParameter("formCnName");
			String create_name=getRequest().getParameter("creater");
			String create_time=getRequest().getParameter("createtime");
			String sql="update PTEM_SEARCH set SEARCH_NAME_EN='"+search_name_en
			+"',SEARCH_NAME_CN='"+search_name_cn+"',CREATE_NAME='"+create_name
			+"',CREATE_TIME=to_date('"+create_time+"','yyyy-MM-dd') where id='"+autoFormId+"'";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
			//return ERROR;
		}
	}
	public String getKeywordSearchByID() throws Exception{
		try {
			String autoFormId = getRequest().getParameter("autoFormId");
			String type = getRequest().getParameter("typeId"); //如果是1，则查看，2则修改
			String sql="select QUERY_FIELD,QUERY_TABLE," +
					"CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"CONDITION_TABLE,MAIN_FIELD,FOREIGN_FIELD," +
					"OWNER from PTEM_SEARCH_KEYWORD where id='"+autoFormId+"'";
			List<Object[]> list=dbService.queryDataBySql(sql);
			//AutoFormsNew af = autoFormService.getAutoFormsNewById(autoFormId);
			//getRequest().setAttribute("af", af);
			String QUERY_FIELD="";
			String QUERY_TABLE="";
			String CONDITION_FIELD_EN="";
			String CONDITION_FIELD_CN="";
			String CONDITION_TABLE="";
			String MAIN_FIELD="";
			String FOREIGN_FIELD="";
			String OWNER="";
			
			if(list.get(0)[0]!=null)
			{
				QUERY_FIELD=list.get(0)[0].toString();
			}						
			if(list.get(0)[1]!=null)
			{
				QUERY_TABLE=list.get(0)[1].toString();
			}						
			if(list.get(0)[2]!=null)
			{
				CONDITION_FIELD_EN=list.get(0)[2].toString();
			}						
			if(list.get(0)[3]!=null)
			{
				CONDITION_FIELD_CN=list.get(0)[3].toString();
			}					
			if(list.get(0)[4]!=null)
			{
				CONDITION_TABLE=list.get(0)[4].toString();
			}					
			if(list.get(0)[5]!=null)
			{
				MAIN_FIELD=list.get(0)[5].toString();
			}	
			if(list.get(0)[6]!=null)
			{
				FOREIGN_FIELD=list.get(0)[6].toString();
			}		
			if(list.get(0)[7]!=null)
			{
				OWNER=list.get(0)[7].toString();
			}			
			getRequest().setAttribute("autoFormId", autoFormId);
			getRequest().setAttribute("QUERY_FIELD", QUERY_FIELD);
			getRequest().setAttribute("QUERY_TABLE", QUERY_TABLE);
			getRequest().setAttribute("CONDITION_FIELD_EN", CONDITION_FIELD_EN);
			getRequest().setAttribute("CONDITION_FIELD_CN", CONDITION_FIELD_CN);
			getRequest().setAttribute("CONDITION_TABLE", CONDITION_TABLE);
			getRequest().setAttribute("MAIN_FIELD", MAIN_FIELD);
			getRequest().setAttribute("FOREIGN_FIELD", FOREIGN_FIELD);
			getRequest().setAttribute("OWNER", OWNER);
			if("1".equals(type)){
				return "toViewKeyWord";
			}else{
				return "toUpdateKeyWord";
			}
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
	}
	
	public String getSelectSearchByID() throws Exception{
		try {
			String autoFormId = getRequest().getParameter("autoFormId");
			String type = getRequest().getParameter("typeId"); //如果是1，则查看，2则修改
			String sql="select QUERY_FIELD,QUERY_TABLE," +
					"CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"CONDITION_TABLE,MAIN_FIELD,FOREIGN_FIELD,OWNER," +
					"DICTIONARY_TABLE,CONDITION_FIELD_VALUE," +
					"CONDITION_TABLE_CN,CONNECT_TABLE,CONNECT_FIELD," +
					"CONNECT_FIELD_CON " +
					" from PTEM_SEARCH_SELECT where id='"+autoFormId+"'";
			List<Object[]> list=dbService.queryDataBySql(sql);
			//AutoFormsNew af = autoFormService.getAutoFormsNewById(autoFormId);
			//getRequest().setAttribute("af", af);
			String QUERY_FIELD="";
			String QUERY_TABLE="";
			String CONDITION_FIELD_EN="";
			String CONDITION_FIELD_CN="";
			String CONDITION_TABLE="";
			String MAIN_FIELD="";
			String FOREIGN_FIELD="";
			String OWNER="";
			String DICTIONARY_TABLE="";
			String CONDITION_FIELD_VALUE="";
			String CONDITION_TABLE_CN="";
			String CONNECT_TABLE="";
			String CONNECT_FIELD="";
			String CONNECT_FIELD_CON="";
			if(list.get(0)[0]!=null)
			{
				QUERY_FIELD=list.get(0)[0].toString();
			}						
			if(list.get(0)[1]!=null)
			{
				QUERY_TABLE=list.get(0)[1].toString();
			}						
			if(list.get(0)[2]!=null)
			{
				CONDITION_FIELD_EN=list.get(0)[2].toString();
			}						
			if(list.get(0)[3]!=null)
			{
				CONDITION_FIELD_CN=list.get(0)[3].toString();
			}					
			if(list.get(0)[4]!=null)
			{
				CONDITION_TABLE=list.get(0)[4].toString();
			}					
			if(list.get(0)[5]!=null)
			{
				MAIN_FIELD=list.get(0)[5].toString();
			}	
			if(list.get(0)[6]!=null)
			{
				FOREIGN_FIELD=list.get(0)[6].toString();
			}		
			if(list.get(0)[7]!=null)
			{
				OWNER=list.get(0)[7].toString();
			}		
			if(list.get(0)[8]!=null)
			{
				DICTIONARY_TABLE=list.get(0)[8].toString();
			}	
			if(list.get(0)[9]!=null)
			{
				CONDITION_FIELD_VALUE=list.get(0)[9].toString();
			}	
			if(list.get(0)[10]!=null)
			{
				CONDITION_TABLE_CN=list.get(0)[10].toString();
			}	
			if(list.get(0)[11]!=null)
			{
				CONNECT_TABLE=list.get(0)[11].toString();
			}	
			if(list.get(0)[12]!=null)
			{
				CONNECT_FIELD=list.get(0)[12].toString();
			}	
			if(list.get(0)[13]!=null)
			{
				CONNECT_FIELD_CON=list.get(0)[13].toString();
			}	
			getRequest().setAttribute("autoFormId", autoFormId);
			getRequest().setAttribute("QUERY_FIELD", QUERY_FIELD);
			getRequest().setAttribute("QUERY_TABLE", QUERY_TABLE);
			getRequest().setAttribute("CONDITION_FIELD_EN", CONDITION_FIELD_EN);
			getRequest().setAttribute("CONDITION_FIELD_CN", CONDITION_FIELD_CN);
			getRequest().setAttribute("CONDITION_TABLE", CONDITION_TABLE);
			getRequest().setAttribute("MAIN_FIELD", MAIN_FIELD);
			getRequest().setAttribute("FOREIGN_FIELD", FOREIGN_FIELD);
			getRequest().setAttribute("DICTIONARY_TABLE", DICTIONARY_TABLE);
			getRequest().setAttribute("CONDITION_FIELD_VALUE", CONDITION_FIELD_VALUE);
			getRequest().setAttribute("CONDITION_TABLE_CN", CONDITION_TABLE_CN);
			getRequest().setAttribute("CONNECT_TABLE", CONNECT_TABLE);
			getRequest().setAttribute("CONNECT_FIELD", CONNECT_FIELD);
			getRequest().setAttribute("CONNECT_FIELD_CON", CONNECT_FIELD_CON);
			
			if("1".equals(type)){
				return "toViewSelect";
			}else{
				return "toUpdateSelect";
			}
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
	}
	
	public String getAutoSearchByID() throws Exception{
		try {
			String autoFormId = getRequest().getParameter("autoFormId");
			String type = getRequest().getParameter("typeId"); //如果是1，则查看，2则修改
			String sql="select SEARCH_NAME_EN,SEARCH_NAME_CN," +
					"CREATE_NAME,CREATE_TIME from PTEM_SEARCH where id='"+autoFormId+"'";
			List<Object[]> list=dbService.queryDataBySql(sql);
			//AutoFormsNew af = autoFormService.getAutoFormsNewById(autoFormId);
			//getRequest().setAttribute("af", af);
			String enname=list.get(0)[0].toString();
			String cnname=list.get(0)[1].toString();
			String creater=list.get(0)[2].toString();
			String createtime=list.get(0)[3].toString();
			getRequest().setAttribute("autoFormId", autoFormId);
			getRequest().setAttribute("formEnName", enname);
			getRequest().setAttribute("enname", enname);
			getRequest().setAttribute("cnname", cnname);
			getRequest().setAttribute("creater", creater);
			getRequest().setAttribute("createtime", createtime);
			if("1".equals(type)){
				return "toView";
			}else{
				return "toUpdate";
			}
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
	}
	
	
	//保存日期查询
	public void saveDateSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			String queryTable=getRequest().getParameter("queryTable");
			String queryField=getRequest().getParameter("queryField");
			String connectTable=getRequest().getParameter("connectTable");
			String connectField=getRequest().getParameter("connectField");
			String connectFieldCon=getRequest().getParameter("connectFieldCon");
			String conditionTable=getRequest().getParameter("conditionTable");
			String conditionField=getRequest().getParameter("conditionField");		
			String conditionFieldCn=getRequest().getParameter("conditionFieldCn");	
			String conditionMain=getRequest().getParameter("conditionMain");
			String queryForeign=getRequest().getParameter("queryForeign");
			String owner=getRequest().getParameter("searchname");
	
			String sql="insert into ptem_search_date(ID,QUERY_TABLE," +
					"QUERY_FIELD,CONNECT_TABLE,CONNECT_FIELD,CONNECT_FIELD_Con," +
					"CONDITION_TABLE,CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"MAIN_FIELD,FOREIGN_FIELD,OWNER) values(" +
					"SEQ_ptem_search_keyword.nextval,'"+queryTable+"','"+
					queryField+"','"+connectTable+"','"+connectField+"','"+
					connectFieldCon+"','"+
					conditionTable+"','"+conditionField+
					"','"+conditionFieldCn+"','"+conditionMain+"','"+
					queryForeign+"','"+owner+"')";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
//			}else{
//				//表已存在
//				out.print("{\"result\":\"errorExist\"}");
//			}
		} catch (Exception e) {
			out.print("{\"result\":\"error\"}");
			e.printStackTrace();
		}
	}
	//保存区间查询
	public void saveRangeSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			String queryTable=getRequest().getParameter("queryTable");
			String queryField=getRequest().getParameter("queryField");
			String conditionTable=getRequest().getParameter("conditionTable");
			String conditionField=getRequest().getParameter("conditionField");
			String conditionFieldCn=getRequest().getParameter("conditionFieldCn");	
			String conditionMain=getRequest().getParameter("conditionMain");
			String queryForeign=getRequest().getParameter("queryForeign");
			String owner=getRequest().getParameter("searchname");
	
			String sql="insert into ptem_search_range(ID,QUERY_TABLE," +
					"QUERY_FIELD,CONDITION_TABLE,CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"MAIN_FIELD,FOREIGN_FIELD,OWNER) values(" +
					"SEQ_ptem_search_keyword.nextval,'"+queryTable+"','"+
					queryField+"','"+conditionTable+"','"+conditionField+
					"','"+conditionFieldCn+"','"+conditionMain+"','"+
					queryForeign+"','"+owner+"')";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
//			}else{
//				//表已存在
//				out.print("{\"result\":\"errorExist\"}");
//			}
		} catch (Exception e) {
			out.print("{\"result\":\"error\"}");
			e.printStackTrace();
		}
	}
	
	//保存选择查询
	public void saveSelectSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			String queryTable=getRequest().getParameter("queryTable");
			String queryField=getRequest().getParameter("queryField");
			
			String connectTable=getRequest().getParameter("connectTable");
			String connectField=getRequest().getParameter("connectField");
			String connectFieldCon=getRequest().getParameter("connectFieldCon");
		
			String conditionTable=getRequest().getParameter("conditionTable");
			String conditionField=getRequest().getParameter("conditionField");
			String conditionFieldCn=getRequest().getParameter("conditionFieldCn");	
			String conditionMain=getRequest().getParameter("conditionMain");
			String queryForeign=getRequest().getParameter("queryForeign");
			String owner=getRequest().getParameter("searchname");
			String dictionaryTable=getRequest().getParameter("dictionaryTable");
			String conditionFieldValue=getRequest().getParameter("conditionFieldValue");
			String conditionTableCn=getRequest().getParameter("conditionTableCn");
			String sql="insert into PTEM_SEARCH_SELECT(ID,QUERY_TABLE," +
					"QUERY_FIELD,CONNECT_TABLE,CONNECT_FIELD,CONNECT_FIELD_Con," +
					"CONDITION_TABLE,CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"MAIN_FIELD,FOREIGN_FIELD,OWNER,DICTIONARY_TABLE," +
					"CONDITION_FIELD_VALUE,CONDITION_TABLE_CN) values(" +
					"SEQ_ptem_search_keyword.nextval,'"+queryTable+"','"+
					
					queryField+"','"+
					connectTable+"','"+connectField+"','"+connectFieldCon+"','"
					+conditionTable+"','"+conditionField+
					"','"+conditionFieldCn+"','"+conditionMain+"','"+
					queryForeign+"','"+owner+"','"+dictionaryTable+"','"+
					conditionFieldValue+"','"+
					conditionTableCn+"')";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
//			}else{
//				//表已存在
//				out.print("{\"result\":\"errorExist\"}");
//			}
		} catch (Exception e) {
			out.print("{\"result\":\"error\"}");
			e.printStackTrace();
		}
	}
	//保存关键字查询
	public void saveKeywordSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			String queryTable=getRequest().getParameter("queryTable");
			String queryField=getRequest().getParameter("queryField");
			String conditionTable=getRequest().getParameter("conditionTable");
			String conditionField=getRequest().getParameter("conditionField");
			String conditionFieldCn=getRequest().getParameter("conditionFieldCn");	
			String conditionMain=getRequest().getParameter("conditionMain");
			String queryForeign=getRequest().getParameter("queryForeign");
			String owner=getRequest().getParameter("searchname");
	
			String sql="insert into PTEM_SEARCH_KEYWORD(ID,QUERY_TABLE," +
					"QUERY_FIELD,CONDITION_TABLE,CONDITION_FIELD_EN,CONDITION_FIELD_CN," +
					"MAIN_FIELD,FOREIGN_FIELD,OWNER) values(" +
					"SEQ_ptem_search_keyword.nextval,'"+queryTable+"','"+
					queryField+"','"+conditionTable+"','"+conditionField+
					"','"+conditionFieldCn+"','"+conditionMain+"','"+
					queryForeign+"','"+owner+"')";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
//			}else{
//				//表已存在
//				out.print("{\"result\":\"errorExist\"}");
//			}
		} catch (Exception e) {
			out.print("{\"result\":\"error\"}");
			e.printStackTrace();
		}
	}
	//保存自定义查询
	public void saveAutoSearch() throws Exception{
		PrintWriter out = getResponse().getWriter();
		try {
			String userName = this.getUserName();
			//String userId = this.getUserId();
			String strFormEnName=getRequest().getParameter("formEnName");
			String strFormCnName=getRequest().getParameter("formCnName");
			Date date=new Date();
		    DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String time=format.format(date);
			String sql="insert into PTEM_SEARCH(ID,SEARCH_NAME_EN," +
					"SEARCH_NAME_CN,CREATE_NAME,CREATE_TIME) values(" +
					"SEQ_PTEM_SEARCH.nextval,'"+strFormEnName+"','"+
					strFormCnName+"','"+userName+"',to_date('"+time+"','yyyy-MM-dd HH24:mi:ss'))";
			dbService.exeSql(sql);
			out.print("{\"result\":\"success\"}");
//			}else{
//				//表已存在
//				out.print("{\"result\":\"errorExist\"}");
//			}
		} catch (Exception e) {
			out.print("{\"result\":\"error\"}");
			e.printStackTrace();
		}
	}
	//删除自定义查询记录
	public void deleteAutoSearch() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try {
			String ids = getRequest().getParameter("ids");
			String tableName ="ptem_search";
			String deleteSql = "delete from "+ tableName +" t where t.id in("+ids+")";
			dbService.exeSql(deleteSql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	//删除关键字查询记录
	public void deleteKeywordSearch() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try {
			String ids = getRequest().getParameter("ids");
			String tableName ="ptem_search_keyword";
			String deleteSql = "delete from "+ tableName +" t where t.id in("+ids+")";
			dbService.exeSql(deleteSql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	public void deleteSelectSearch() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try {
			String ids = getRequest().getParameter("ids");
			String tableName ="ptem_search_select";
			String deleteSql = "delete from "+ tableName +" t where t.id in("+ids+")";
			dbService.exeSql(deleteSql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	public void deleteRangeSearch() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try {
			String ids = getRequest().getParameter("ids");
			String tableName ="ptem_search_range";
			String deleteSql = "delete from "+ tableName +" t where t.id in("+ids+")";
			dbService.exeSql(deleteSql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	public void deleteDateSearch() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try {
			String ids = getRequest().getParameter("ids");
			String tableName ="ptem_search_date";
			String deleteSql = "delete from "+ tableName +" t where t.id in("+ids+")";
			dbService.exeSql(deleteSql);
			out.print("{\"result\":\"success\"}");
		} catch (Exception e) {
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	//查询自定义查询列表
	public void queryAutoSearch(){
		try {			
			Map<String, String> filterMap = getPagerMap();
			String formsCnName = getRequest().getParameter("formsCnName");
			if(formsCnName != null && !"".equals(formsCnName)){
				formsCnName = StringUtil.encodingUrl(formsCnName);
			}
			String formsEnName = getRequest().getParameter("formsEnName");
			if(formsEnName != null && !"".equals(formsEnName)){
				formsEnName = StringUtil.encodingUrl(formsEnName);
			}
			String type = getRequest().getParameter("type");
			//将查询条件保存到Map里
			filterMap.put("form_cn_name", formsCnName);
			filterMap.put("form_en_name", formsEnName);
			filterMap.put("type", type);
			String[] viewArray = { "ID", "form_cn_name","form_en_name","create_name","create_time"};
			// 查询所有的数据
			PageResult result = pipePointService.queryAutoSearch(filterMap);
			String returnStr = getColumnJson(result, viewArray);
			setContentType();
			PrintWriter out = getResponse().getWriter();
			//System.out.println("--!"+returnStr+"--!");
			System.out.println(returnStr);
			out.print(returnStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//获取管段平面长度
	public double getPsPlaneLength(double y1,double y2,double x1,double x2){
		double length=0.0;
		length=Math.sqrt(Math.pow((y1-y2),2)+Math.pow((x1-x2), 2));
		return  length;
	}
	public double getPsRealLength(double y1,double y2,
			double x1,double x2,double h1,double h2){
		double length=0.0;
		length=Math.sqrt(Math.pow((y1-y2),2)+Math.pow((x1-x2), 2)+Math.pow((h1-h2),2));
		return  length;
	}
	public int getMapLevel(double length)
	{
		//[19,20m];[18,50m];[17,100m];[16,200m];[15,500m];[14,1km];[13,2km]
		//[12,5km];[11,10km]
		int level=0;
		if(length<50)
		{
			level=19;
		}
		else if(length<100)
		{
			level=18;
		}
		else if(length<200)
		{
			level=17;
		}
		else if(length<500)
		{
			level=16;
		}
		else if(length<1000)
		{
			level=15;
		}
		else if(length<2000)
		{
			level=14;
		}
		else if(length<5000)
		{
			level=13;
		}
		return level;
	}
	public double getFistLatitude(List list) throws IOException{
		Object[] objs = (Object[])list.get(0);				
		String strID=(String)objs[0];	
		double Latitude=0;
		double ls1=Double.parseDouble(objs[1].toString()); 	//起点经度
		double le1=Double.parseDouble(objs[2].toString()); 	//终点经度
		double bs1=Double.parseDouble(objs[3].toString()); 	//起点纬度
		double be1=Double.parseDouble(objs[4].toString());	//终点纬度
		int size=list.size();
		int i;
		for(i=1;i<size;i++)
		{
			objs = (Object[])list.get(i);				
			strID=(String)objs[0];
			double ls=Double.parseDouble(objs[1].toString()); 	//起点经度
			double le=Double.parseDouble(objs[2].toString()); 	//终点经度
			double bs=Double.parseDouble(objs[3].toString()); 	//起点纬度
			double be=Double.parseDouble(objs[4].toString());	//终点纬度
			if(ls==ls1||le==ls1)
			{
				break;
			}
		}
		if(i==size)
		{
			Latitude=le1;
		}
		else
		{
			Latitude=ls1;
		}
		return Latitude;
	}
	public void getPipeLineNode(List list) throws IOException{
		double latitudeE=0;
		int count=0;
		//要查找的经度
		latitudeE=getFistLatitude(list);
		list.remove(0);
		List lineList;
		
	}
	public void InitPipeStru(List list)
	{
		pipeSecStructList=new ArrayList();
		pipeSecStructListTee=new ArrayList();
		int size=list.size();
		for(int i=0;i<size;i++)
		{
			int countS=1;
			int countE=1;
			Object[] objs = (Object[])list.get(i);				
			String strID=(String)objs[0];  //管段编号
			double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
			double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
			double b1=Double.parseDouble(objs[3].toString()); 	//起点纬度
			double b2=Double.parseDouble(objs[4].toString());	//终点纬度
			
			Object[] objStruct=new Object[8];
			objStruct[0]=objs[0];//管段编号
			objStruct[1]=objs[1];//起点经度	
			objStruct[2]=objs[2];//终点经度
			objStruct[3]=objs[3];//起点纬度
			objStruct[4]=objs[4];//终点纬度
			objStruct[5]=0;  //起点类型
			objStruct[6]=0;  //终点类型
			objStruct[7]=false; //是否已排序
			for(int j=0;j<size;j++)
			{
				if(j==i)
				{
					continue;
				}
				Object[] objsTemp = (Object[])list.get(j);				
				String strIDTemp=(String)objs[0];  //管段编号
				double l1Temp=Double.parseDouble(objsTemp[1].toString()); 	//起点经度
				double l2Temp=Double.parseDouble(objsTemp[2].toString()); 	//终点经度
				double b1Temp=Double.parseDouble(objsTemp[3].toString()); 	//起点纬度
				double b2Temp=Double.parseDouble(objsTemp[4].toString());	//终点纬度
				if(l1Temp==l1)
				{
					countS++;
				}
				if(l2Temp==l1)
				{
					countS++;
				}
				if(l1Temp==l2)
				{
					countE++;
				}
				if(l2Temp==l2)
				{
					countE++;
				}
			}
			objStruct[5]=countS;  //起点类型
			objStruct[6]=countE;  //终点类型
			pipeSecStructList.add(objStruct);
			if(countS>2||countE>2)
			{
				pipeSecStructListTee.add(objStruct);
			}
		}		
	}
	public void getNodeTypeNum()
	{
		int num3=0;
		int num1=0;
		int num2=0;
		int size=pipeSecStructList.size();
		for(int i=0;i<size;i++)
		{
			Object[] objs = (Object[])pipeSecStructList.get(i);				
//			String strID=(String)objs[0];  //管段编号
//			double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
//			double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
//			double b1=Double.parseDouble(objs[3].toString()); 	//起点纬度
//			double b2=Double.parseDouble(objs[4].toString());	//终点纬度
			int sType=Integer.parseInt(objs[5].toString());		//起点类型
			int eType=Integer.parseInt(objs[6].toString());		//起点类型
			if(sType==1)
			{
				num1++;
			}
			if(eType==1)
			{
				num1++;			
			}
			else if(sType==2)
			{
				num2++;
			}
			else if(eType==2)
			{
				num2++;			
			}
			else if(sType>2)
			{
				num3++;
			}
			else if(eType>2)
			{
				num3++;			
			}
		}
		m_num1=num1;
		m_num2=num2;
		m_num3=num3;
	}
//	public List<Object[]> SearchPipeSec(Object[] objsFirst,double latitude,String strSkipID)
//	{
//		List<Object[]> result=new ArrayList<Object[]>();
//		result.add(objsFirst);
//		int num=pipeSecStructList.size();
//		int type=0;
//		while(true)
//		{
//			int i;
//			for(i=0;i<num;i++)
//			{
//				Object[] objs = (Object[])pipeSecStructList.get(i);				
//				String strID=(String)objs[0];  //管段编号
//				if(strID.equals(strSkipID))
//				{
//					continue;
//				}
//				double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
//				double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
//				//double b1=Double.parseDouble(objs[3].toString()); //起点纬度
//				//double b2=Double.parseDouble(objs[4].toString());	//终点纬度
//				int sType=Integer.parseInt(objs[5].toString());		//起点类型
//				int eType=Integer.parseInt(objs[6].toString());		//终点类型
//				boolean isSorted=Boolean.parseBoolean(objs[7].toString());
//				if(isSorted==true) //已排序
//				{
//					continue;
//				}
//				if(l1==latitude)
//				{
//					latitude=l2;
//					objs[7]=true; //已排序
//					result.add(objs);
//					pipeSecStructList.set(i,objs);
//					type=sType;
//					break;
//				}
//				if(l2==latitude)
//				{
//					latitude=l1;
//					objs[7]=true; //已排序
//					result.add(objs);
//					pipeSecStructList.set(i,objs);
//					type=eType;
//					break;
//				}				
//			}
//			if(type!=2||i==num)
//			{
//				break;
//			}
//		}	
//		return result;
//	}

	public List<Object[]> SearchPipeSec(Object[] objsFirst,double latitude,Object[] objNode)
	{
		List<Object[]> result=new ArrayList<Object[]>();
		result.add(objsFirst);
		int num=pipeSecStructList.size();
		int type=0;
		while(true)
		{
			int i;
			for(i=0;i<num;i++)
			{
				Object[] objs = (Object[])pipeSecStructList.get(i);				
//				String strID=(String)objs[0];  //管段编号
//				if(strID.equals(strSkipID))
//				{
//					continue;
//				}
				double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
				double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
				double b1=Double.parseDouble(objs[3].toString()); //起点纬度
				double b2=Double.parseDouble(objs[4].toString());	//终点纬度
				int sType=Integer.parseInt(objs[5].toString());		//起点类型
				int eType=Integer.parseInt(objs[6].toString());		//终点类型
				boolean isSorted=Boolean.parseBoolean(objs[7].toString());
				if(isSorted==true) //已排序
				{
					continue;
				}
				if(l1==latitude)  //起点相等
				{
					latitude=l2;
					objs[7]=true; //已排序
					result.add(objs);
					pipeSecStructList.set(i,objs);
					type=sType;
					//节点赋值
					objNode[3]=l2;   //终点经度
					objNode[4]=b2;	 //终点纬度
					break;
				}
				if(l2==latitude) //终点相等
				{
					latitude=l1;
					objs[7]=true; //已排序
					result.add(objs);
					pipeSecStructList.set(i,objs);
					type=eType;
					//节点赋值
					objNode[3]=l1;   //终点经度
					objNode[4]=b1;	 //终点纬度
					break;
				}				
			}
			if(type!=2||i==num)
			{
				break;
			}
		}	
		return result;
	}

	public void SortPipeSectionTee(String pipeLineNo)
	{
		int num=pipeSecStructList.size();
		for(int i=0;i<num;i++)
		{
			Object[] objs = (Object[])pipeSecStructList.get(i);				
			String strID=(String)objs[0];  //管段编号
			double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
			double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
			double b1=Double.parseDouble(objs[3].toString()); 	//起点纬度
			double b2=Double.parseDouble(objs[4].toString());	//终点纬度
			int sType=Integer.parseInt(objs[5].toString());		//起点类型
			int eType=Integer.parseInt(objs[6].toString());		//终点类型
			boolean isSorted=Boolean.parseBoolean(objs[7].toString());
			if(isSorted==true) //已排序
			{
				continue;
			}
			if(sType<3&&eType<3) //起点终点都不是三叉点
			{
				continue;
			}
			objs[7]=true; //已排序
			pipeSecStructList.set(i,objs);
			if(sType>2&&eType>2) //起点终点都为三叉点
			{
				List<Object[]> list=new ArrayList<Object[]>();
				list.add(objs);
				pipeSecStructListSorted.add(list);	
				Object[] objNode=new Object[5];
				objNode[0]=pipeLineNo;
				objNode[1]=l1;  //起点经度
				objNode[2]=b1;	//起点纬度
				objNode[3]=l2;   //终点经度
				objNode[4]=b2;	 //终点纬度
				pipeLineNodeList.add(objNode);
				continue;
			}
			if(sType>2) //起点为三叉点
			{
				Object[] objNode=new Object[5];
				objNode[0]=pipeLineNo;
				objNode[1]=l1;  //起点经度
				objNode[2]=b1;	//起点纬度
				objNode[3]=l2;   //终点经度
				objNode[4]=b2;	 //终点纬度
				List<Object[]> list=SearchPipeSec(objs,l2,objNode);
				pipeSecStructListSorted.add(list);
				pipeLineNodeList.add(objNode);
			}
			if(eType>2) //终点为三叉点
			{	
				Object[] objNode=new Object[5];
				objNode[0]=pipeLineNo;
				objNode[1]=l2;//起点经度
				objNode[2]=b2;//起点纬度
				objNode[3]=l1;   //终点经度
				objNode[4]=b1;	 //终点纬度
				List<Object[]> list=SearchPipeSec(objs,l1,objNode);
				pipeSecStructListSorted.add(list);
				pipeLineNodeList.add(objNode);
			}
		}
	}
	
	public void SortPipeSection1(String pipeLineNo)
	{
		int num=pipeSecStructList.size();
		for(int i=0;i<num;i++)
		{
			Object[] objs = (Object[])pipeSecStructList.get(i);	
			boolean isSorted=Boolean.parseBoolean(objs[7].toString());
			if(isSorted==true)
			{
				continue;
			}
			String strID=(String)objs[0];  //管段编号
			double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
			double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
			double b1=Double.parseDouble(objs[3].toString()); 	//起点纬度
			double b2=Double.parseDouble(objs[4].toString());	//终点纬度
			int sType=Integer.parseInt(objs[5].toString());		//起点类型
			int eType=Integer.parseInt(objs[6].toString());		//终点类型
			if(sType!=1&&eType!=1) //起点终点都不是断点
			{
				continue;
			}
			objs[7]=true; //已排序
			pipeSecStructList.set(i,objs);
			if(sType==1) //起点为断点
			{
				Object[] objNode=new Object[5];
				objNode[0]=pipeLineNo;
				objNode[1]=l1;  //起点经度
				objNode[2]=b1;	//起点纬度
				objNode[3]=l2;   //终点经度
				objNode[4]=b2;	 //终点纬度
				List<Object[]> list=SearchPipeSec(objs,l2,objNode);
				pipeSecStructListSorted.add(list);
				pipeLineNodeList.add(objNode);
			}
			if(eType==1) //终点为断点
			{	
				Object[] objNode=new Object[5];
				objNode[0]=pipeLineNo;
				objNode[1]=l2;  //起点经度
				objNode[2]=b2;	//起点纬度
				objNode[3]=l1;   //终点经度
				objNode[4]=b1;	 //终点纬度
				List<Object[]> list=SearchPipeSec(objs,l1,objNode);
				pipeSecStructListSorted.add(list);
				pipeLineNodeList.add(objNode);
			}
		}
	}
	public void SortPipeSection(String pipeLineNo)
	{
		String sql ="select t.id,t.beginnodeL,t.endnodeL,t.beginnodeB,t.endnodeB " +
		"from ptem_pipesection t where t.pipelineno='" +
		pipeLineNo+"' order by beginnodel ";
		List list=dbService.queryDataBySql(sql);
		InitPipeStru(list);
	//	getNodeTypeNum();		
		pipeSecStructListSorted=new ArrayList<List<Object[]>>();	//排序后的管段数组
		pipeLineNodeList=new ArrayList<Object[]>();
		SortPipeSectionTee(pipeLineNo);
		SortPipeSection1(pipeLineNo);
		int size=pipeLineNodeList.size();
		
		for(int i=0;i<size;i++)
		{
			Object [] obj=pipeLineNodeList.get(i);
			String strBeginNodeL=obj[1].toString();
			String strBeginNodeB=obj[2].toString();
			String strEndNodeL=obj[3].toString();
			String strEndNodeB=obj[4].toString();
			String strId = "SEQ_PTEM_PIPELINE_NODE.nextval";
			String sqlInsert ="insert into PTEM_PIPELINE_NODE(ID," +
					"PIPELINENO,BEGINNODEL,BEGINNODEB,ENDNODEL,ENDNODEB)" +
					"values("+strId+",'"+pipeLineNo+"',"+strBeginNodeL+","+
					strBeginNodeB+","+strEndNodeL+","+strEndNodeB+")";
			dbService.exeSql(sqlInsert);	
		}
		System.out.println("ok");
	}
	public void getNode(List list,double latitudeE,double longitudeE,List nodeList)
	{
		if(latitudeE==116.77041264||
				latitudeE==116.77041092||
				latitudeE==116.77040983)
		{
			System.out.println("---");
			System.out.println(latitudeE);
			System.out.println("---");
		}
		List<Double> teeLatitudeEList=new ArrayList<Double>();
		List<Double> teeLongitudeEList=new ArrayList<Double>();
		List<Integer> teeIndex=new ArrayList<Integer>();
		int index=0;
		int count=0;
		do
		{
			count=0;
			double latitudeETemp = latitudeE;
			double longitudeETemp =longitudeE;
			for(int i=0;i<list.size();i++){
				Object[] objs = (Object[])list.get(i);				
				String strID=(String)objs[0];
				double l1=Double.parseDouble(objs[1].toString()); 	//起点经度
				double l2=Double.parseDouble(objs[2].toString()); 	//终点经度
				double b1=Double.parseDouble(objs[3].toString()); 	//起点纬度
				double b2=Double.parseDouble(objs[4].toString());	//终点纬度
				if(l1==latitudeE)
				{
					if(count==0)
					{
						latitudeETemp=l2;
						longitudeETemp=b2;
						index=i;
						list.remove(index);	
						i--;
					}
					else{	
						teeLatitudeEList.add(l2);
						teeLongitudeEList.add(b2);
						index=i;
						list.remove(index);	
						i--;
//						nodeList.add(list.get(index));
						Object[] e=new Object[2];
						e[0]=latitudeE;
						e[1]=longitudeE;
						//nodeList.add(e);
						int size=nodeList.size();
						int k;
						for(k=0;k<size;k++)
						{
							Object[] objsTemp = (Object[])nodeList.get(k);				
							double lTemp=Double.parseDouble(objsTemp[0].toString()); 	//起点经度
							if(lTemp==latitudeE)
							{
								break;
							}
						}
						if(k==size)
						{
							nodeList.add(e);
						}
					}
					count++;
				}
				if(l2==latitudeE)
				{
					if(count==0)
					{
						index=i;
						latitudeETemp=l1;
						longitudeETemp=b1;
						list.remove(index);
						i--;
					}
					else
					{
						teeLatitudeEList.add(l1);
						teeLongitudeEList.add(b1);
						index=i;
						list.remove(index);
						i--;
						Object[] e =new Object[2];
						e[0]=latitudeE;
						e[1]=longitudeE;
						int size=nodeList.size();
						int k;
						for(k=0;k<size;k++)
						{
							Object[] objsTemp = (Object[])nodeList.get(k);				
							double lTemp=Double.parseDouble(objsTemp[0].toString()); 	//起点经度
							if(lTemp==latitudeE)
							{
								break;
							}
						}
						if(k==size)
						{
							nodeList.add(e);
						}						
					}
					count++;
				}
			}
			latitudeE=latitudeETemp;
			longitudeE=longitudeETemp;	
			if(latitudeE==116.77041264||
					latitudeE==116.77041092||
					latitudeE==116.77040983)
			{
				System.out.println("---");
				System.out.println(latitudeE);
				System.out.println("---");
			}
		}while(count!=0);	
		Object[] e =new Object[2];
		e[0]=latitudeE;
		e[1]=longitudeE;
		//nodeList.add(e);
		int size=nodeList.size();
		int k;
		for(k=0;k<size;k++)
		{
			Object[] objsTemp = (Object[])nodeList.get(k);				
			double lTemp=Double.parseDouble(objsTemp[0].toString()); 	//起点经度
			if(lTemp==latitudeE)
			{
				break;
			}
		}
		if(k==size)
		{
			nodeList.add(e);
		}
		int  teeSize=teeLatitudeEList.size();
		for(int j=0;j<teeSize;j++)
		{
			double LatitudeE=teeLatitudeEList.get(j);
			double LongitudeE=teeLongitudeEList.get(j);
			getNode(list,LatitudeE,LongitudeE,nodeList);
		}	
	}
	public void updatePipeLineNode(String pipeLineNo) throws IOException{
		String sql ="select t.id,t.beginnodeL,t.endnodeL,t.beginnodeB,t.endnodeB " +
		"from ptem_pipesection t where t.pipelineno='" +
		pipeLineNo+"' order by beginnodel ";
		List list=dbService.queryDataBySql(sql);
		//
		Object[] objs1;
		double latitudeE=0;
		double longitudeE=0;
		int size=0;
		List nodeList=new ArrayList();
		//
		objs1 = (Object[])list.get(0);				
		latitudeE=Double.parseDouble(objs1[2].toString()); 	//终点经度
		longitudeE=Double.parseDouble(objs1[4].toString()); //终点纬度
		list.remove(0);
		//
		getNode(list,latitudeE,longitudeE,nodeList);
		size=list.size();	
		while(size>0)
		{
			objs1 = (Object[])list.get(0);				
			latitudeE=Double.parseDouble(objs1[2].toString()); 	//终点经度
			longitudeE=Double.parseDouble(objs1[4].toString()); //终点纬度
			list.remove(0);
			//
			getNode(list,latitudeE,longitudeE,nodeList);
			size=list.size();
		}		
		int nodeListSize=nodeList.size();
		for(int k=0;k<nodeListSize;k++)
		{
			Object[] objsTemp = (Object[])nodeList.get(k);				
			double lTemp=Double.parseDouble(objsTemp[0].toString()); 
			System.out.println(lTemp);
		}
		System.out.println("ok");
	}
	//更新资料审查表3
	public void updateMaterialReview()throws IOException{
		String sql="select t.id,t.PIPELINENO from PTEM_MATERIALS_REVIEW t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object objs[]=list.get(i);
			String id=objs[0].toString();
			String pipelineno="";
			if(objs[1]==null)
			{
				continue;	
			}
			pipelineno=objs[1].toString();
			//表B
			//管线长度、工程名称、管道规格、管道级别
			//管道材质、防腐方式（防腐层类型）、阴极保护方式（阴极保护类型）
			//表A
			//设计单位、设计规范、施工单位
			//施工规范、防腐单位、防腐规范、竣工日期
			//铺设方式、通气日期、
			sql="select t.LENGTH,t.PROJECTNAME,t.DIAMETER,t.PRESSURELEVEL," +
					"MATERIAL,COATINGTYPE,CPTYPE";
			sql+=" from ptem_pipeline t where t.pipelineno='";
			sql+=pipelineno;
			sql+="'";
			List<Object[]> pipelinelist=dbService.queryDataBySql(sql);
			Object objvalues[]=pipelinelist.get(0);
			String length="";
			String projectname="";
			String diameter="";
			String pressurelevel="";
			String meterial="";
			String coatingtype="";
			String cptype="";
			if(objvalues[0]!=null)
			{
				length=objvalues[0].toString();
			}
			if(objvalues[1]!=null)
			{
				projectname=objvalues[1].toString();
			}
			if(objvalues[2]!=null)
			{
				diameter=objvalues[2].toString();
			}
			if(objvalues[3]!=null)
			{
				pressurelevel=objvalues[3].toString();
			}
			if(objvalues[4]!=null)
			{
				meterial=objvalues[4].toString();
			}
			if(objvalues[5]!=null)
			{
				coatingtype=objvalues[5].toString();
			}
			if(objvalues[6]!=null)
			{
				cptype=objvalues[6].toString();
			}
			sql="update PTEM_MATERIALS_REVIEW t set t.PIPELINELENGTH='";
			sql+=length;
			sql+="',t.PROJECTNAME='";
			sql+=projectname;
			sql+="',t.PIPESTANDARD='";
			sql+=diameter;
			sql+="',t.PIPELEVEL='";
			sql+=pressurelevel;
			sql+="',t.PIPEMATERIAL='";
			sql+=meterial;
			sql+="',t.CORROSIONPROTECTIOMODE='";
			sql+=coatingtype;
			sql+="',t.CPTYPE='";
			sql+=cptype;
			sql+="'where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	public void updatePipeSectionFromPipeline() throws IOException{
		String sql="select t.id,t.PIPELINENO from ptem_pipesection t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object objs[]=list.get(i);
			String id=objs[0].toString();
			String pipelineno="";
			if(objs[1]==null)
			{
				continue;	
			}
			pipelineno=objs[1].toString();
			//压力级制、通气时间、铺设方式、材质、材质牌号、
			//通径、外径、壁厚、管理单位、管理部门
			sql="select t.PRESSURELEVEL,t.AERATEDATE,t.PAVEMODE,t.MATERIAL,t.MATERIALMARK," +
					"t.DIAMETER,t.OUTERDIAMETER,t.THICKNESS,t.MANAGEUNIT,t.MANAGEDEPARTMENT";
			sql+=" from ptem_pipeline t where t.pipelineno='";
			sql+=pipelineno;
			sql+="'";
			sql+="and( t.PRESSURELEVEL is not null or t.AERATEDATE is not null or " +
					"t.PAVEMODE is not null or t.MATERIAL is not null or " +
					"t.MATERIALMARK is not null or t.DIAMETER is not null or " +
					"t.OUTERDIAMETER is not null or t.THICKNESS is not null or " +
					"t.MANAGEUNIT is not null or t.MANAGEDEPARTMENT is not null)";
			List<Object[]> pipelinelist=dbService.queryDataBySql(sql);
			if(pipelinelist.size()==0)
			{
				continue;
			}
			Object objvalues[]=pipelinelist.get(0);
			String pressurelevel="";
			String areatedate="";
			String pavemode="";
			String material="";
			String materialmark="";
			String diameter="";
			String outerdiameter="";
			String thickness="";
			String manageunit="";
			String managedepartment="";
			if(objvalues[0]!=null)
			{
				pressurelevel=objvalues[0].toString();
			}
			if(objvalues[1]!=null)
			{
				areatedate=objvalues[1].toString();
			}
			if(objvalues[2]!=null)
			{
				pavemode=objvalues[2].toString();
			}
			if(objvalues[3]!=null)
			{
				material=objvalues[3].toString();
			}
			if(objvalues[4]!=null)
			{
				materialmark=objvalues[4].toString();
			}
			if(objvalues[5]!=null)
			{
				diameter=objvalues[5].toString();
				String diameters[]=diameter.split("；");
				diameter=diameters[0];
			}
			if(objvalues[6]!=null)
			{
				outerdiameter=objvalues[6].toString();
				String outerdiameters[]=outerdiameter.split("；");
				outerdiameter=outerdiameters[0];
			}
			if(objvalues[7]!=null)
			{
				thickness=objvalues[7].toString();
				String thicknesss[]=thickness.split("；");
				thickness=thicknesss[0];
			}
			if(objvalues[8]!=null)
			{
				manageunit=objvalues[8].toString();
			}
			if(objvalues[9]!=null)
			{
				managedepartment=objvalues[9].toString();
			}
			//压力级制、通气时间、铺设方式、材质、材质牌号、
			//通径、外径、壁厚、管理单位、管理部门
			sql="update ptem_pipesection t set t.PRESSURELEVEL='";
			sql+=pressurelevel;
			sql+="',t.AERATEDATE=to_date('";
			sql+=areatedate;
			sql+="','YYYY-MM-DD')";
			sql+=",t.PAVEMODE='";
			sql+=pavemode;
			sql+="',t.MATERIAL='";
			sql+=material;
			sql+="',t.MATERIALMARK='";
			sql+=materialmark;
			sql+="',t.DIAMETER='";
			sql+=diameter;
			sql+="',t.OUTERDIAMETER='";
			sql+=outerdiameter;
			sql+="',t.THICKNESS='";
			sql+=thickness;
			sql+="',t.MANAGEUNIT='";
			sql+=manageunit;
			sql+="',t.MANAGEDEPARTMENT='";
			sql+=managedepartment;
			sql+="' where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	public String updateJudgerepeatSingle(String planelength,String reallength,
			String beginnodex,String beginnodey,String beginnodeh,
			String endnodex,String endnodey,String endnodeh) throws IOException{
			String res="";
			if(planelength.equals("0")&&!reallength.equals("0"))
			{
				res="立管";
			}
			else if(planelength.equals("0")&&beginnodex.equals(endnodex)&&
					beginnodey.equals(endnodey)&&beginnodeh.equals(endnodeh))
			{
				res="重复";
			}
			return res;
	}
	public void updateJudgerepeat() throws IOException{
		String planelength="";
		String reallength="";
		String beginnodex="";
		String beginnodey="";
		String beginnodeh="";
		String endnodex="";
		String endnodey="";
		String endnodeh="";
		String id="";
		String sql="select t.id,t.PLANELENGTH,t.REALLENGTH,t.BEGINNODEX," +
				"t.BEGINNODEY,t.BEGINNODEH,t.ENDNODEX,t.ENDNODEY," +
				"t.ENDNODEH from PTEM_PIPESECTION t ";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			if(obj[0]!=null)
			{
				id=obj[0].toString();
			}
			if(obj[1]!=null)
			{
				planelength=obj[1].toString();
			}
			if(obj[2]!=null)
			{
				reallength=obj[2].toString();
			}
			if(obj[3]!=null)
			{
				beginnodex=obj[3].toString();
			}
			if(obj[4]!=null)
			{
				beginnodey=obj[4].toString();
			}
			if(obj[5]!=null)
			{
				beginnodeh=obj[5].toString();
			}
			if(obj[6]!=null)
			{
				endnodex=obj[6].toString();
			}
			if(obj[7]!=null)
			{
				endnodey=obj[7].toString();
			}
			if(obj[8]!=null)
			{
				endnodeh=obj[8].toString();
			}
			String judge=updateJudgerepeatSingle(planelength, reallength, beginnodex, beginnodey, beginnodeh, endnodex, endnodey, endnodeh);
			sql="update ptem_pipesection t set t.JUDGEREPEAT='";
			sql+=judge;
			sql+="'where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	//更新管线长度
	public void updatePipelength() throws IOException{
		String sql="select id,pipelineno from ptem_pipeline t where t.pipelineno is not null";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			String id=obj[0].toString();
			String pipelineno=obj[1].toString();
			sql="select t.PLANELENGTH from ptem_pipesection t where t.pipelineno='";
			sql+=pipelineno;
			sql+="'";
			List<String> listlength=dbService.queryDataBySql(sql);
			int secnum=listlength.size();
			Double sumlength=0.0;
			for(int j=0;j<secnum;j++)
			{
				String strlength=listlength.get(j);
				Double length=Double.parseDouble(strlength);
				sumlength+=length;
			}
			String strsumlength=sumlength.toString();
			sql="update ptem_pipeline t set t.length='";
			sql+=strsumlength;
			sql+="' where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	//更新管段表
	public void updatePipeSection() throws IOException{
		//更新管线编号
		//updatePipeLineNo("ptem_pipesection","PIPESECTIONNO");
		//更新继承自管线表中的字段
		updatePipeSectionFromPipeline();
		//更新管段长度
		//updatePipeSectionLength();
		//判断立管和重复
		//updateJudgerepeat();
	}
	//更新管段表中的平面长度、实际长度
	public void updatePipeSectionLength() throws IOException{
		//更新管段表长度
		String sql ="select t.id,t.beginnodey,t.endnodey,t.beginnodex,t.endnodex," +
				"t.beginnodeh,t.endnodeh from ptem_pipesection t  " +
				//"where planelength='0' or reallength='0' ";
				"where t.planelength is null or t.reallength is null ";
		List list=dbService.queryDataBySql(sql);
		for(int i=0;i<list.size();i++){
			Object[] objs = (Object[])list.get(i);				
			String strID=(String)objs[0];
			double y1=Double.parseDouble(objs[1].toString());
			double y2=Double.parseDouble(objs[2].toString());
			double x1=Double.parseDouble(objs[3].toString());
			double x2=Double.parseDouble(objs[4].toString());
			double h1=Double.parseDouble(objs[5].toString());
			double h2=Double.parseDouble(objs[6].toString());
			double planeLength=getPsPlaneLength(y1,y2,x1,x2);
			double realLength=getPsRealLength(y1,y2,x1,x2,h1,h2);
			String strPlaneLength=Double.toString(planeLength);
			String strRealLength=Double.toString(realLength);
			sql="update ptem_pipesection t set t.planelength='"+
			strPlaneLength+"',t.reallength='"+strRealLength+"'" +
					"where t.id='"+strID+"'";
			dbService.exeSql(sql);
		}
	}
	public void updatePipeLineCoord(){
		String sql ="select pipelineno from ptem_pipeline";
        List<String> list=dbService.queryDataBySql(sql);
		int size=list.size();
		for(int i=0;i<size;i++)
		{
			String pipeLineNo=list.get(i);
			//String pipeLineNo="010811818";				
			//管段排序获取管线节点
			SortPipeSection(pipeLineNo);
		}			
	}
	//根据管网编号更新管线编号
	public void updatePipeLineNo(String tablename){
		String sql="select t.id,t.PIPENO from ";
		sql+=tablename;
		sql+=" t where t.pipeno is not null";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			String id=obj[0].toString();
			String pipeno=obj[1].toString();
			String pipelineno=pipeno.substring(0,9);
			String sqlUpdate="update ";
			sqlUpdate+=tablename;
			sqlUpdate+=" t set t.pipelineno='";
			sqlUpdate+=pipelineno;
			sqlUpdate+="'";
			sqlUpdate+="where t.id='";
			sqlUpdate+=id;
			sqlUpdate+="'";
			dbService.exeSql(sqlUpdate);
		}
	}
	//根据管网编号更新管线编号
	public void updatePipeLineNo(String tablename,String fieldname){
		String sql="select t.id,t.";
		sql+=fieldname;
		sql+=" from ";
		sql+=tablename;
		sql+=" t where t.";
		sql+=fieldname;
		sql+=" is not null";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			String id=obj[0].toString();
			String pipeno=obj[1].toString();
			String pipelineno=pipeno.substring(0,9);
			String sqlUpdate="update ";
			sqlUpdate+=tablename;
			sqlUpdate+=" t set t.pipelineno='";
			sqlUpdate+=pipelineno;
			sqlUpdate+="'";
			sqlUpdate+="where t.id='";
			sqlUpdate+=id;
			sqlUpdate+="'";
			dbService.exeSql(sqlUpdate);
		}
	}
	
	public void updatePipeLineNo(){
		String tablename="PTEM_EMERGENCY";//表G 应急事件
		updatePipeLineNo(tablename);
		tablename="PTEM_OPERATIONS"; //生产作业
		updatePipeLineNo(tablename);
		tablename="ptem_point_crossing"; //穿跨越
		updatePipeLineNo(tablename);
	}
	public void updateDictionaryTable()
	{
		String sql="select t.field,t.ownertable,t.dictionary from ptem_fielddic_map t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			String field=obj[0].toString();
			String ownertable=obj[1].toString();
			String dictionary=obj[2].toString();
			sql="select distinct ";
			sql+=field;
			sql+=" from ";
			sql+=ownertable;
			sql+=" where ";
			sql+=field;
			sql+=" is not null";
			List<Object> fieldValues=dbService.queryDataBySql(sql);
			//删除字典表中原来的数据
			sql="delete from ";
			sql+=dictionary;
			dbService.exeSql(sql);
			//更新字典表
			int valueNum=fieldValues.size();
			for(int j=0;j<valueNum;j++)
			{
				String fieldValue=null;
				if(dictionary.equals("PTEM_TYPE_DESIGNTEMPRATURE"))
				{
					fieldValue=fieldValues.get(j).toString();
				}
				else
				{
					fieldValue=fieldValues.get(j).toString();
				}
				
				if(fieldValue==null)
				{
					continue;
				}
				String id=Integer.toString(j+1);
				String sqlT="insert into ";
				sqlT+=dictionary;
				sqlT+="(id,TYPENAME,TYPEINDEX)values('";
				sqlT+=id;
				if(dictionary.equals("PTEM_TYPE_DESIGNTEMPRATURE"))
				{
					sqlT+="',";
					sqlT+=fieldValue;
					sqlT+=",'";
					sqlT+=id;
					sqlT+="')";
				}
				else{
					sqlT+="','";
					sqlT+=fieldValue;
					sqlT+="','";
					sqlT+=id;
					sqlT+="')";
				}
				
				dbService.exeSql(sqlT);
			}	
		}
	}
	//更新特征点表的特征点编号
	public void updatePointNo(String tablename,String noName,String title) throws IOException{
		String sql="select t.id,t.pipelineno from ";
		sql+=tablename;
		sql+=" t" ;
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=list.get(i);
			String id=obj[0].toString();
			String pipelineno=obj[1].toString();
			//计算流水号
			String serialNo="";
			serialNo=String.format("%04d", i+1);
			String pointNoVal=title+pipelineno+serialNo;
			sql="update ";
			sql+=tablename;
			sql+=" t set t.";
			sql+=noName;
			sql+="='";
			sql+=pointNoVal;
			sql+="' where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	public void updatePointNoAll() throws IOException{
		//特征点检测中的特征点编号
		updatePointNo("ptem_point_test","pointno","TSD");
		//特征点表的特征点编号
		updatePointNo("ptem_pipepoint","pointno","TSD");
//		//三通编号
//		updatePointNo("ptem_point_tee","teeno","ST");
//		//阳极编号
//		updatePointNo("ptem_point_anode","anodeno","YJ");
//		//测试桩
//		//排流装置
//		//穿跨越
//		//套管
//		updatePointNo("ptem_point_casing","casingno","TG");
//		//弯管编号
//		updatePointNo("ptem_point_bend","bendno","WG");
//		//内衬
//		//土壤检测点编号
//		updatePointNo("ptem_soilcorrosion","testpointno","TRD");
//		//杂散检测点编号
//		updatePointNo("ptem_straycurrenttest","STRAYPOINTNO","ZSD");
//		//破损点编号
//		updatePointNo("ptem_coating_damagedpoint","DAMAGEPOINTNO","PSD");
	}
	//转换经纬度
	public void convertLongitudeLatitude() throws IOException{
		String sql="select t.id,t.longitude,t.latutide from ptem_cips_test_data t";
		List list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] obj=(Object[]) list.get(i);
			String id=obj[0].toString();
			if(id.equals("111"))
			{
				continue;
			}
			String longitude=obj[1].toString();
			String latitude=obj[2].toString();
			//转换经度
			String longiLeft=longitude.substring(0,3);
			String longiRight=longitude.substring(3);
			Integer longiLeftI=Integer.parseInt(longiLeft);
			Double longiRightD=Double.parseDouble(longiRight);
			Double longitudeNewD=longiLeftI+longiRightD/60;
			String longitudeNew=longitudeNewD.toString();
			//转换纬度
			String latiLeft=latitude.substring(0,2);
			String latiRight=latitude.substring(2);
			Integer latiLeftI=Integer.parseInt(latiLeft);
			Double latiRightD=Double.parseDouble(latiRight);
			Double latitudeNewD=latiLeftI+latiRightD/60;
			String latitudeNew=latitudeNewD.toString();
			//更新
			sql="update ptem_cips_test_data t set t.longitude='";
			sql+=longitudeNew;
			sql+="'";
			sql+=" ,t.latutide='";
			sql+=latitudeNew;
			sql+="'";
			sql+=" where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	
	//更新TSG压力级别
	public void updateTSG() throws IOException{
		String sql="select t.id,t.MEDIA,t.DESIGNPRESSURE from PTEM_PIPELINE t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object[] objs=list.get(i);
			String id=objs[0].toString();    //ID
			String media="";
			String strdesignpressure="";
			if(objs[1]!=null)
			{
				media=objs[1].toString(); //运行介质
			}
			if(objs[2]!=null)
			{
				strdesignpressure=objs[2].toString(); //设计压力
			}
			
			String TSG="";	//TSG压力级别
			if(media.equals("液化石油气"))
			{
				TSG="/";
			}
			else
			{
				//设计压力
				Double designpressure=Double.parseDouble(strdesignpressure);
				if(designpressure>2.5&&designpressure<=4.0)
				{
					TSG="GB1-I";
				}
				else if(designpressure>1.6&&designpressure<=2.5)
				{
					TSG="GB1-II";
				}
				else if(designpressure>0.8&&designpressure<=1.6)
				{
					TSG="GB1-III";
				}
				else if(designpressure>0.4&&designpressure<=0.8)
				{
					TSG="GB1-IV";
				}
				else if(designpressure>0.2&&designpressure<=0.4)
				{
					TSG="GB1-V";
				}
				else if(designpressure>0.1&&designpressure<=0.2)
				{
					TSG="GB1-VI";
				}
			}
			sql="update ptem_pipeline t set t.TSGPRESSURELEVEL='";
			sql+=TSG;
			sql+="' where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	public void updateCrossingTest() throws IOException{
		String sql="select t.id,t.crossingno from PTEM_CROSSING_TEST t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();
		for(int i=0;i<num;i++)
		{
			Object objs[]=list.get(i);
			String id=objs[0].toString();
			String crossingno="";
			if(objs[1]==null)
			{
				continue;	
			}
			crossingno=objs[1].toString();
			//穿跨越描述信息、穿越类型、穿越对象类型、穿越方式
			sql="select t.CROSSINGDESCRIPTION,t.CROSSINGTYPE,t.OBJECTTYPE,t.CROSSINGWAY";
			sql+=" from PTEM_POINT_CROSSING t where t.CROSSINGNO='";
			sql+=crossingno;
			sql+="'";
			List<Object[]> pipelinelist=dbService.queryDataBySql(sql);
			Object objvalues[]=pipelinelist.get(0);
			String crossingdescription="";
			String crossingtype="";
			String objecttype="";
			String crossingway="";
			if(objvalues[0]!=null)
			{
				crossingdescription=objvalues[0].toString();
			}
			if(objvalues[1]!=null)
			{
				crossingtype=objvalues[1].toString();
			}
			if(objvalues[2]!=null)
			{
				objecttype=objvalues[2].toString();
			}
			if(objvalues[3]!=null)
			{
				crossingway=objvalues[3].toString();
			}
			sql="update PTEM_CROSSING_TEST t set t.CROSSINGINFO='";
			sql+=crossingdescription;
			sql+="',t.CROSSINGTYPE='";
			sql+=crossingtype;
			sql+="',t.OBJECTTYPE='";
			sql+=objecttype;
			sql+="',t.CROSSINGWAY='";
			sql+=crossingway;
			sql+="' where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	public void updatePipeLineField() throws IOException{
		String sql="update ptem_pipeline t1 set t1.AERATEDATE = ";
		sql+="(select t2.AERATEDATE from PTEM_PROJECT_INFO t2 where t2.PROJECTNO=t1.PROJECTNO)";
		dbService.exeSql(sql);
	}
	public void updatePipeLine() throws IOException{
		//更新通气时间
		updatePipeLineField();
		//更新管线长度
		updatePipelength();
		//更新表B管线中的TSG压力级制
		updateTSG();
	}
	public void updatePipeSectionNoAll() throws IOException{
		//更新特征点表中的管段编号
		updatePipeSectionNo("ptem_pipepoint","pipesectionno","locationx","locationy");
	}
	//更新管网编号
	public void updatePipeSectionNo(String tablename,String fieldname,String fieldx,String fieldy) throws IOException{
		String sql;
		sql="select t.id,t."+fieldx+",t."+fieldy+" from "+tablename+" t";
		List<Object[]> list=dbService.queryDataBySql(sql);
		int num=list.size();		
		for(int i=0;i<num;i++)
		{
			Object[] data=list.get(i);
			String id=data[0].toString();
			String x=data[1].toString();
			String y=data[2].toString();
			sql="select t.pipesectionno,pointtoline(t.beginnodex,t.beginnodey,t.endnodex,t.endnodey,"+x+","+y+")from ptem_pipesection t";
			List<Object[]> listdis=dbService.queryDataBySql(sql);
			int disnum=listdis.size();
			String strdis=listdis.get(0)[1].toString();
			Double dis=Double.parseDouble(strdis);
			Double dismin=dis;
			int indexmin=0;
			for(int j=1;j<disnum;j++)
			{
				strdis=listdis.get(j)[1].toString();
				dis=Double.parseDouble(strdis);
				if(dis<dismin)
				{
					dismin=dis;
					indexmin=j;
				}
			}
			String pipesectionno=listdis.get(indexmin)[0].toString();
			sql="update "+tablename+" t set t."+fieldname+" ='";
			sql+=pipesectionno;
			sql+="'where t.id='";
			sql+=id;
			sql+="'";
			dbService.exeSql(sql);
		}
	}
	
	
//	public void updatePipesectionno() throws IOException{
//		String sql;
//		sql="select t.id,t.locationx,t.locationy from ptem_pipepoint t";
//		List<Object[]> list=dbService.queryDataBySql(sql);
//		int num=list.size();		
//		for(int i=0;i<num;i++)
//		{
//			Object[] data=list.get(i);
//			String id=data[0].toString();
//			String x=data[1].toString();
//			String y=data[2].toString();
//			sql="select t.pipesectionno,pointtoline(t.beginnodex,t.beginnodey,t.endnodex,t.endnodey,"+x+","+y+")from ptem_pipesection t";
//			List<Object[]> listdis=dbService.queryDataBySql(sql);
//			int disnum=listdis.size();
//			String strdis=listdis.get(0)[1].toString();
//			Double dis=Double.parseDouble(strdis);
//			Double dismin=dis;
//			int indexmin=0;
//			for(int j=1;j<disnum;j++)
//			{
//				strdis=listdis.get(j)[1].toString();
//				dis=Double.parseDouble(strdis);
//				if(dis<dismin)
//				{
//					dismin=dis;
//					indexmin=j;
//				}
//			}
//			String pipesectionno=listdis.get(indexmin)[0].toString();
//			sql="update ptem_pipepoint t set t.pipesectionno ='";
//			sql+=pipesectionno;
//			sql+="'where t.id='";
//			sql+=id;
//			sql+="'";
//			dbService.exeSql(sql);
//		}
//	}
//	
//	
//	public void updatePipesectionno() throws IOException{
//		String sql;
//		sql="select t.pipesectionno,t.BEGINNODEX,t.BEGINNODEY," +
//				"t.ENDNODEX,t.ENDNODEY from ptem_pipesection t";
//		List<Object[]> listsec=dbService.queryDataBySql(sql);
//		int secnum=listsec.size();
//		sql="select t.id,t.locationx,t.locationy from ptem_pipepoint t";
//		List<Object[]> list=dbService.queryDataBySql(sql);
//		int num=list.size();		
//		for(int i=0;i<num;i++)
//		{
//			Object[] data=list.get(i);
//			String id=data[0].toString();
//			String x=data[1].toString();
//			String y=data[2].toString();
//			String x1= listsec.get(0)[1].toString();
//			String y1= listsec.get(0)[2].toString();
//			String x2= listsec.get(0)[3].toString();
//			String y2= listsec.get(0)[4].toString();
//			sql="select pointToLine("+x1+","+y1+","+x2+","+y2+","+x+","+y+") from dual";
//			List <Object> listdis=dbService.queryDataBySql(sql);
//			String strdis=listdis.get(0).toString();	
//			Double dis=Double.parseDouble(strdis);	
//			Double dismin=dis;
//			int disIndex=0;
//			for(int j=0;j<secnum;j++)
//			{
//				//String pipesectionno=listsec.get(j)[0].toString();
//				x1=listsec.get(j)[1].toString();
//				y1=listsec.get(j)[2].toString();
//				x2=listsec.get(j)[3].toString();
//				y2=listsec.get(j)[4].toString();
//				sql="select pointToLine("+x1+","+y1+","+x2+","+y2+","+x+","+y+") from dual";
//				listdis=dbService.queryDataBySql(sql);
//				strdis=listdis.get(0).toString();	
//				dis=Double.parseDouble(strdis);	
//				if(dis<dismin)
//				{
//					dismin=dis;
//					disIndex=j;
//				}
//			}
//			String pipesectionno=listsec.get(disIndex)[0].toString();
//			sql="update ptem_pipepoint t set t.pipesectionno ='";
//			sql+=pipesectionno;
//			sql+="'where t.id='";
//			sql+=id;
//			sql+="'";
//			dbService.exeSql(sql);
//		}
//	}
	public void updatePointPole() throws IOException{
		
	}
	public void updateDBData() throws IOException{
		setContentType();
		PrintWriter out = getResponse().getWriter();
		try
		{	
			//更新特征点表的管段编号
			//updatePipeSectionNoAll();
			//更新管段表
			updatePipeSection();
			//更新管线表
			//updatePipeLine();
			//更新表4-2穿跨越检测
			//updateCrossingTest();
			//更新表3
			//updateMaterialReview();			
			//转换表5-9中的经纬度
			//convertLongitudeLatitude();
			//更新各表中的编号
			//updatePointNoAll();
			//更新字典表
			//updateDictionaryTable();
			//更新管线编号
			//updatePipeLineNo();
			//更新管线坐标
			//updatePipeLineCoord();
			
			out.print("{\"result\":\"success\"}");
		}
		catch(Exception e)
		{
			e.printStackTrace();
			out.print("{\"result\":\"error\"}");
		}
	}
	public void getGuanxianListByTaskSearch() throws IOException{
		String kfieldname1= getRequest().getParameter("kfieldname1");
		String kfieldvalue=getRequest().getParameter("kfieldvalue");
		System.out.print(kfieldname1);
		System.out.print(kfieldvalue);
	}
	public void getFieldname1s() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		String strSql = "select t.fieldname,t.fieldcnname from ptem_fieldname1 t" +
				" where queryuser='任务查询'";
		List lists = dbService.queryDataBySql(strSql);
		for(int i=0;i<lists.size();i++){
			Object[] objs = (Object[])lists.get(i);
			JSONObject jsonobj = new JSONObject();
			jsonobj.put("id", objs[0]);
			jsonobj.put("text", objs[1]);
			jsonArray.add(jsonobj);
		}
		out.print(jsonArray.toString());
	}
	public void setPipePointService(PipePointService pipePointService) {
		this.pipePointService = pipePointService;
	}
	//查一个管线下所有违导波检测坐标
	public void getDaobojiancePointAll() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		String id = getRequest().getParameter("id").replace("dbjcRoot", "");
		String strSql = "select t1.LONGITUDE,t1.LATITUDE from PTEM_GUIDEDWAVES_TEST t1 " +
			" where t1.pipelineno='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonArray.add(jsonobj);
			}
			else{
				break;
			}
		}
		out.print(jsonArray.toString());
	}
	
	
	//查导波检测坐标
//	public void getDaobojiancePoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		JSONArray jsonArray = new JSONArray();
//		String id = getRequest().getParameter("id").replace("dbjc", "");
//		String strSql = "select t1.LONGITUDE,t1.LATITUDE from PTEM_GUIDEDWAVES_TEST t1 " +
//			" where t1.pipeno='"+id+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		//jsonobj.put("picfilename", objs[2]==null?"":objs[2].toString());
//		out.print(jsonobj.toString());
//	}
//	
	
	//查测所有试桩坐标
	public void getPolePointAll() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		String id = getRequest().getParameter("id").replace("pointPoleRoot", "");
		String strSql = "select t1.LONGITUDE,t1.LATITUDE from PTEM_POINT_POLE t1 " +
			" where t1.pipelineno='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonArray.add(jsonobj);
			}
			else{
				break;
			}
		}
		out.print(jsonArray.toString());
	}
	//查测试桩坐标
//	public void getPolePoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		String id = getRequest().getParameter("id").replace("pointPole", "");
//		String strSql = "select t1.LONGITUDE,t1.LATITUDE from PTEM_POINT_POLE t1 " +
//			" where t1.POLENO='"+id+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		//jsonobj.put("picfilename", objs[2]==null?"":objs[2].toString());
//		out.print(jsonobj.toString());
//	}
	//查询阀门坐标
//	public void getValvePoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		String valveId = getRequest().getParameter("valveId").replace("valve", "");
//		String strSql = "select t1.LONGITUDE,t1.LATITUDE from ptem_valve t1 " +
//			" where t1.pipeno='"+valveId+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		//jsonobj.put("picfilename", objs[2]==null?"":objs[2].toString());
//		out.print(jsonobj.toString());
//	}
	//查询三通所有坐标
	public void getTeePointAll() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		String id = getRequest().getParameter("id").replace("pointTeeRoot", "");
		String strSql = "select t1.LONGITUDE,t1.LATITUDE from ptem_point_tee t1" +
				" where t1.pipelineno='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonArray.add(jsonobj);
			}
			else{
				break;
			}
		}
		out.print(jsonArray.toString());
	}
	public void getSantong() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");				
		String sql="select TYPE,MAINTHICKNESS,MAINDIAMETER," +
				"BRANCHTHICKNESS,BRANCHDIAMETER,PRESSURELEVEL," +
				"LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,"+
				"REMARK,PIPELINENO,PIPESECTIONNO,ATTACHMENT"+
				" from PTEM_POINT_TEE";
		sql+=" where TEENO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("type", objs[0]==null?"":objs[0].toString());
		jsonobj.put("mainthickness", objs[1]==null?"":objs[1].toString());
		jsonobj.put("maindiameter", objs[2]==null?"":objs[2].toString());
		jsonobj.put("branchthickness", objs[3]==null?"":objs[3].toString());
		jsonobj.put("branchdiameter", objs[4]==null?"":objs[4].toString());
		jsonobj.put("pressurelevel", objs[5]==null?"":objs[5].toString());
		jsonobj.put("locationy", objs[6]==null?"":objs[6].toString());
		jsonobj.put("locationx", objs[7]==null?"":objs[7].toString());
		jsonobj.put("height", objs[8]==null?"":objs[8].toString());
		jsonobj.put("longitude", objs[9]==null?"":objs[9].toString());
		jsonobj.put("latitude", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ellipseh", objs[11]==null?"":objs[11].toString());
		jsonobj.put("remark", objs[12]==null?"":objs[12].toString());
		jsonobj.put("pipelineno", objs[13]==null?"":objs[13].toString());
		jsonobj.put("pipesectionno", objs[14]==null?"":objs[14].toString());
		String codeid=objs[15]==null?"":objs[15].toString();
		sql="select t.file_path from tdm_attachment t where t.code_id='"+codeid+"'";
		List<String> listFile=dbService.queryDataBySql(sql);
		String filepath="";
		String filename="";
		if(listFile.size()!=0)
		{			
			filepath=listFile.get(0)==null?"":listFile.get(0).toString();
			String ctxDir = getRequest().getSession().getServletContext()
			.getInitParameter("filePath");
			if (!ctxDir.endsWith(String.valueOf(File.separatorChar))) {
				ctxDir = ctxDir + File.separatorChar;
			}
			filepath=ctxDir+filepath;
		}
		if(!filepath.equals(""))
		{
			int index=filepath.lastIndexOf("\\");
			int length=filepath.length();
			filename=filepath.substring(index+1,length);
		}
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		out.print(jsonobj.toString());
	}
	//获取阳极信息
	public void getYangji() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");	
		String sql="select ANODENUM,ANODESTANDARD,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,LOCATIONDESCRIPTION," +
				"REMARK,PIPELINENO,PIPESECTIONNO,ATTACHMENT from PTEM_POINT_ANODE";
		sql+=" where ANODENO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("ANODENUM", objs[0]==null?"":objs[0].toString());
		jsonobj.put("ANODESTANDARD", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("HEIGHT", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LONGITUDE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LATITUDE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("ELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REMARK", objs[9]==null?"":objs[9].toString());
		jsonobj.put("PIPELINENO", objs[10]==null?"":objs[10].toString());
		jsonobj.put("PIPESECTIONNO", objs[11]==null?"":objs[11].toString());
		String codeid=objs[12]==null?"":objs[12].toString();
		sql="select t.file_path from tdm_attachment t where t.code_id='"+codeid+"'";
		List<String> listFile=dbService.queryDataBySql(sql);
		String filepath="";
		String filename="";
		if(listFile.size()!=0)
		{			
			filepath=listFile.get(0)==null?"":listFile.get(0).toString();
			String ctxDir = getRequest().getSession().getServletContext()
			.getInitParameter("filePath");
			if (!ctxDir.endsWith(String.valueOf(File.separatorChar))) {
				ctxDir = ctxDir + File.separatorChar;
			}
			filepath=ctxDir+filepath;
		}
		if(!filepath.equals(""))
		{
			int index=filepath.lastIndexOf("\\");
			int length=filepath.length();
			filename=filepath.substring(index+1,length);
		}
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		out.print(jsonobj.toString());
	}
	//获取附件等的文件名称
	public String getfilename(String filepath) throws IOException{	
		String filename="";
		if(!filepath.equals(""))
		{
			int index=filepath.lastIndexOf("\\");
			int length=filepath.length();
			filename=filepath.substring(index+1,length);
		}
		return filename;
	}
	//获取附件等的文件路径
	public String getfilepath(String codeid) throws IOException{		
		String sql="select t.file_path from tdm_attachment t where t.code_id='"+codeid+"'";
		List<String> listFile=dbService.queryDataBySql(sql);
		String filepath="";
		String filename="";
		if(listFile.size()!=0)
		{			
			filepath=listFile.get(0)==null?"":listFile.get(0).toString();
			String ctxDir = getRequest().getSession().getServletContext()
			.getInitParameter("filePath");
			if (!ctxDir.endsWith(String.valueOf(File.separatorChar))) {
				ctxDir = ctxDir + File.separatorChar;
			}
			filepath=ctxDir+filepath;
		}
		return filepath;
	}
	//获取测试桩信息
	public void getCeshizhuang() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");	
		String sql="select DEVICECODE,PROJECTNO,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,LOCATIONDESCRIPTION," +
				"REMOTEEQUIPMENT,MANAGEUNIT,USETIME,POTENTIAL," +
				"PIPELINENO,PIPESECTIONNO,REMARK,POLETYPE,ATTACHMENT,PHOTO " +
				"from PTEM_POINT_POLE";
		sql+=" where POLENO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("DEVICECODE", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PROJECTNO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("HEIGHT", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LONGITUDE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LATITUDE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("ELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REMOTEEQUIPMENT", objs[9]==null?"":objs[9].toString());
		jsonobj.put("MANAGEUNIT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("USETIME", objs[11]==null?"":objs[11].toString());
		jsonobj.put("POTENTIAL", objs[12]==null?"":objs[12].toString());
		jsonobj.put("PIPELINENO", objs[13]==null?"":objs[13].toString());
		jsonobj.put("PIPESECTIONNO", objs[14]==null?"":objs[14].toString());
		jsonobj.put("REMARK", objs[15]==null?"":objs[15].toString());
		jsonobj.put("POLETYPE", objs[16]==null?"":objs[16].toString());		
		String codeid=objs[17]==null?"":objs[17].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[18]==null?"":objs[18].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取排流装置信息
	public void getPailiuzhuangzhi() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");	
		String sql="select DRAINAGEWAY,REMOTEEQUIPMENT,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,POTENTIAL,MAXCURRENT,MINCURRENT,MEANCURRENT," +
				"DISTURBANCEVOLTAGE,CURRENTDENSITY,DRAINAGEAMOUNT,USETIME,REMARK," +
				"PIPELINENO,PIPESECTIONNO,ATTACHMENT from PTEM_POINT_DRAINAGE";
		sql+=" where DRAINAGECODE='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("DRAINAGEWAY", objs[0]==null?"":objs[0].toString());
		jsonobj.put("REMOTEEQUIPMENT", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("HEIGHT", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LONGITUDE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LATITUDE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("ELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("POTENTIAL", objs[8]==null?"":objs[8].toString());
		jsonobj.put("MAXCURRENT", objs[9]==null?"":objs[9].toString());
		jsonobj.put("MINCURRENT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("MEANCURRENT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("DISTURBANCEVOLTAGE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("CURRENTDENSITY", objs[13]==null?"":objs[13].toString());
		jsonobj.put("DRAINAGEAMOUNT", objs[14]==null?"":objs[14].toString());
		jsonobj.put("USETIME", objs[15]==null?"":objs[15].toString());
		jsonobj.put("REMARK", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("PIPELINENO", objs[17]==null?"":objs[17].toString());
		jsonobj.put("PIPESECTIONNO", objs[18]==null?"":objs[18].toString());
		String codeid=objs[19]==null?"":objs[19].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	//获取管段信息
	public void getGuanduan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");			
		String strSql = "select t.beginnodel_map,t.beginnodeb_map," +
		"t.endnodel_map,t.endnodeb_map,t.PIPELINENO," +
		"t.BEGINNODEY,t.BEGINNODEX,t.BEGINNODEH,"+"t.ENDNODEY,t.ENDNODEX,t.ENDNODEH,"+	
		"t.BEGINNODEL,t.BEGINNODEB,t.BEGINNODEELLIPSOIDH,"+
		"t.ENDNODEL,t.ENDNODEB,t.ENDNODEELLIPSOIDH,"+
		"t.RUNPRESSURELEVEL,t.PRESSURELEVEL,t.AERATEDATE,"+
		"t.PAVEMODE,t.MATERIAL,t.MATERIALMARK,"+
		"t.OUTERDIAMETER,t.THICKNESS,t.PLANELENGTH,"+
		"t.REALLENGTH,t.MANAGEUNIT,t.MANAGEDEPARTMENT,t.REMARK"+
		" from ptem_pipesection t where t.pipesectionno='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		Object[] objs = (Object[])lists.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("beginnodel", objs[0]==null?"":objs[0].toString());
		jsonobj.put("beginnodeb", objs[1]==null?"":objs[1].toString());
		jsonobj.put("endnodel", objs[2]==null?"":objs[2].toString());
		jsonobj.put("endnodeb", objs[3]==null?"":objs[3].toString());
		jsonobj.put("PIPELINENO", objs[4]==null?"":objs[4].toString()); //管线编号
		jsonobj.put("BEGINNODEY", objs[5]==null?"":objs[5].toString()); //起点坐标Y
		jsonobj.put("BEGINNODEX", objs[6]==null?"":objs[6].toString()); //起点坐标X
		jsonobj.put("BEGINNODEH", objs[7]==null?"":objs[7].toString()); //起点高程h
		
		jsonobj.put("ENDNODEY", objs[8]==null?"":objs[8].toString()); //终点坐标Y；
		jsonobj.put("ENDNODEX", objs[9]==null?"":objs[9].toString()); //终点坐标X；
		jsonobj.put("ENDNODEH", objs[10]==null?"":objs[10].toString()); //终点高程h
		
		jsonobj.put("BEGINNODEL", objs[11]==null?"":objs[11].toString()); //起点经度L；
		jsonobj.put("BEGINNODEB", objs[12]==null?"":objs[12].toString()); //起点纬度B；
		jsonobj.put("BEGINNODEELLIPSOIDH", objs[13]==null?"":objs[13].toString()); //起点椭球高H
		
		jsonobj.put("ENDNODEL", objs[14]==null?"":objs[14].toString()); //终点经度L；
		jsonobj.put("ENDNODEB", objs[15]==null?"":objs[15].toString()); //终点纬度B；
		jsonobj.put("ENDNODEELLIPSOIDH", objs[16]==null?"":objs[16].toString()); //终点椭球高H
		
		jsonobj.put("RUNPRESSURELEVEL", objs[17]==null?"":objs[17].toString()); //压力级制（运行单位）
		jsonobj.put("PRESSURELEVEL", objs[18]==null?"":objs[18].toString()); //压力级制
		jsonobj.put("AERATEDATE", objs[19]==null?"":objs[19].toString()); //通气时间
		jsonobj.put("PAVEMODE", objs[20]==null?"":objs[20].toString()); //铺设方式
		jsonobj.put("MATERIAL", objs[21]==null?"":objs[21].toString()); //材质
		jsonobj.put("MATERIALMARK", objs[22]==null?"":objs[22].toString()); //材质牌号
		jsonobj.put("OUTERDIAMETER", objs[23]==null?"":objs[23].toString()); //外径(mm)
		jsonobj.put("THICKNESS", objs[24]==null?"":objs[24].toString()); //壁厚(mm)
		jsonobj.put("PLANELENGTH", objs[25]==null?"":objs[25].toString()); //平面长度(m)
		jsonobj.put("REALLENGTH", objs[26]==null?"":objs[26].toString()); //实际长度(m)
		jsonobj.put("MANAGEUNIT", objs[27]==null?"":objs[27].toString()); //管理单位
		jsonobj.put("MANAGEDEPARTMENT", objs[28]==null?"":objs[28].toString()); //管理部门
		jsonobj.put("REMARK", objs[29]==null?"":objs[29].toString()); //备注
		out.print(jsonobj.toString());
	}
	//获取穿跨越信息
	public void getChuankuayue() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");	
		
		String sql="select PIPENO,CROSSINGDESCRIPTION,BEGINNODEY,BEGINNODEX,BEGINNODEH," +
				"BEGINNODEL,BEGINNODEB,BEGINNODEELLIPSEH,ENDNODEY,ENDNODEX,ENDNODEH," +
				"ENDNODEL,ENDNODEB,UNEARTHELLIPSEH,CROSSINGTYPE,OBJECTTYPE,CROSSINGWAY," +
				"SAFEGUARD,OUTERDIAMETER,THICKNESS,DISTANCE,INANGLE,OUTANGLE," +
				"CURRENTDISTURB,TEMPERATUREIMPACT,CORROSION,COATINGTYPE," +
				"PROJECTNO,PIPELINENO,ATTACHMENT from PTEM_POINT_CROSSING";
		sql+=" where CROSSINGNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("CROSSINGDESCRIPTION", objs[1]==null?"":objs[1].toString());
		jsonobj.put("BEGINNODEY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("BEGINNODEX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("BEGINNODEH", objs[4]==null?"":objs[4].toString());
		jsonobj.put("BEGINNODEL", objs[5]==null?"":objs[5].toString());
		jsonobj.put("BEGINNODEB", objs[6]==null?"":objs[6].toString());
		jsonobj.put("BEGINNODEELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("ENDNODEY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ENDNODEX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("ENDNODEH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ENDNODEL", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ENDNODEB", objs[12]==null?"":objs[12].toString());
		jsonobj.put("UNEARTHELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("CROSSINGTYPE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("OBJECTTYPE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("CROSSINGWAY", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("SAFEGUARD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("OUTERDIAMETER", objs[18]==null?"":objs[18].toString());
		jsonobj.put("THICKNESS", objs[19]==null?"":objs[19].toString());
		jsonobj.put("DISTANCE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("INANGLE", objs[21]==null?"":objs[21].toString());
		jsonobj.put("OUTANGLE", objs[22]==null?"":objs[22].toString());
		jsonobj.put("CURRENTDISTURB", objs[23]==null?"":objs[23].toString());
		jsonobj.put("TEMPERATUREIMPACT", objs[24]==null?"":objs[24].toString());
		jsonobj.put("CORROSION", objs[25]==null?"":objs[25].toString());
		jsonobj.put("COATINGTYPE", objs[26]==null?"":objs[26].toString());
		jsonobj.put("PROJECTNO", objs[27]==null?"":objs[27].toString());
		jsonobj.put("PIPELINENO", objs[28]==null?"":objs[28].toString());
//		String codeid=objs[19]==null?"":objs[19].toString();
//		String filepath=getfilepath(codeid);
//		String filename=getfilename(filepath);
//		jsonobj.put("attachmentpath",filepath);
//		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取套管信息
	public void getTaoguan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数		
		String id = getRequest().getParameter("id");		
		String sql="select PIPENO,CASINGINFO,CASINGTYPE,CASINGLENGTH," +
				"LOCATION,BEGINNODEY,BEGINNODEX,BEGINNODEH," +
				"BEGINNODEL,BEGINNODEB,BEGINNODEELLIPSEH," +
				"ENDNODEY,ENDNODEX,ENDNODEH,ENDNODEL,ENDNODEB,ENDELLIPSEH," +
				"ISFILLED,FILLMEDIA,ISSULATION,ISCPEQUIPMENT,DIAMETER,THICKNESS," +
				"SEALTYPE,ISSHORTCIRCUIT,ISEMPTY,PIPELINENO,ATTACHMENT " +
				"from  PTEM_POINT_CASING";
		sql+=" where CASINGNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("CASINGINFO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("CASINGTYPE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("CASINGLENGTH", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("BEGINNODEY", objs[5]==null?"":objs[5].toString());
		jsonobj.put("BEGINNODEX", objs[6]==null?"":objs[6].toString());
		jsonobj.put("BEGINNODEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("BEGINLONGITUDE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("BEGINNODELATITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("BEGINNODEELLIPSEH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ENDNODEY", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ENDNODEX", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ENDNODEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ENDLONGITUDE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ENDLATITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ENDELLIPSEH", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("ISFILLED", objs[17]==null?"":objs[17].toString());
		jsonobj.put("FILLMEDIA", objs[18]==null?"":objs[18].toString());
		jsonobj.put("ISSULATION", objs[19]==null?"":objs[19].toString());
		jsonobj.put("ISCPEQUIPMENT", objs[20]==null?"":objs[20].toString());
		jsonobj.put("DIAMETER", objs[21]==null?"":objs[21].toString());
		jsonobj.put("THICKNESS", objs[22]==null?"":objs[22].toString());
		jsonobj.put("SEALTYPE", objs[23]==null?"":objs[23].toString());
		jsonobj.put("ISSHORTCIRCUIT", objs[24]==null?"":objs[24].toString());
		jsonobj.put("ISEMPTY", objs[25]==null?"":objs[25].toString());
		jsonobj.put("PIPELINENO", objs[26]==null?"":objs[26].toString());		
		String codeid=objs[27]==null?"":objs[27].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取弯管信息
	public void getWanguan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");		
		String sql="select PIPESECTIONNO,BEGINNODEY,BEGINNODEX,BEGINNODEH," +
				"BEGINNODEL,BEGINNODEB,BEGINNODEELLIPSEH," +
				"ENDNODEY,ENDNODEX,ENDNODEH," +
				"ENDNODEL,ENDNODEB,ENDNODEELLIPSEH," +
				"BENDRADIUS,BENDANGLE,BENDMATERIAL," +
				"PIPELINENO,ATTACHMENT from  PTEM_POINT_BEND";
		sql+=" where BENDNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPESECTIONNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("BEGINNODEY", objs[1]==null?"":objs[1].toString());
		jsonobj.put("BEGINNODEX", objs[2]==null?"":objs[2].toString());
		jsonobj.put("BEGINNODEH", objs[3]==null?"":objs[3].toString());
		jsonobj.put("BEGINNODEL", objs[4]==null?"":objs[4].toString());
		jsonobj.put("BEGINNODEB", objs[5]==null?"":objs[5].toString());
		jsonobj.put("BEGINNODEELLIPSEH", objs[6]==null?"":objs[6].toString());
		jsonobj.put("ENDNODEY", objs[7]==null?"":objs[7].toString());
		jsonobj.put("ENDNODEX", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ENDNODEH", objs[9]==null?"":objs[9].toString());
		jsonobj.put("ENDNODEL", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ENDNODEB", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ENDNODEELLIPSEH", objs[12]==null?"":objs[12].toString());
		jsonobj.put("BENDRADIUS", objs[13]==null?"":objs[13].toString());
		jsonobj.put("BENDANGLE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("BENDMATERIAL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("PIPELINENO", objs[16]==null?"":objs[16].toString());	
		String codeid=objs[17]==null?"":objs[17].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	//获取内衬信息
	public void getNeichen() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select PIPELINENO,LINERDESCRIPTION,BEGINNODEY,BEGINNODEX,BEGINNODEH," +
				"BEGINNODEL,BEGINNODEB,BEGINNODEELLIPSEH," +
				"ENDNODEY,ENDNODEX,ENDNODEH," +
				"ENDNODEL,ENDNODEB,ENDNODEELLIPSEH," +
				"IMPROVEDATE,REMARK,PROJECTNO,ATTACHMENT from  PTEM_POINT_LINER";
		sql+=" where LINERNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPELINENO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("LINERDESCRIPTION", objs[1]==null?"":objs[1].toString());
		jsonobj.put("BEGINNODEY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("BEGINNODEX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("BEGINNODEH", objs[4]==null?"":objs[4].toString());
		jsonobj.put("BEGINNODEL", objs[5]==null?"":objs[5].toString());
		jsonobj.put("BEGINNODEB", objs[6]==null?"":objs[6].toString());
		jsonobj.put("BEGINNODEELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("ENDNODEY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ENDNODEX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("ENDNODEH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ENDNODEL", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ENDNODEB", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ENDNODEELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("IMPROVEDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("REMARK", objs[15]==null?"":objs[15].toString());
		jsonobj.put("PROJECTNO", objs[16]==null?"":objs[16].toString());	
		String codeid=objs[17]==null?"":objs[17].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取阀门信息
	public void getFamen() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");		
		String sql="select PIPENO,VALVENAME,DEVICECODE,PRESSURELEVEL," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"PROJECTNO,TYPE,VALVEFUNCTION,DRIVETYPE,PRESSUREGRADE," +
				"SEALWAY,ISREDUCING,INCONNECTTYPE,INDIAMETER,OUTCONNECTTYPE," +
				"OUTDIAMETER,LOCATIONDESCRIPTION,REMARK,PIPELINENO," +
				"MANAGEDEPARTMENT,MANAGEUNIT,ATTACHMENT,PHOTO,VALVEPITNO " +
				"from  PTEM_VALVE";
		//sql+=" where VALVENO='"+id+"'";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("VALVENAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("DEVICECODE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("PRESSURELEVEL", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONY", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONX", objs[5]==null?"":objs[5].toString());
		jsonobj.put("HEIGHT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LONGITUDE", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LATITUDE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ELLIPSEH", objs[9]==null?"":objs[9].toString());
		jsonobj.put("PROJECTNO", objs[10]==null?"":objs[10].toString());
		jsonobj.put("TYPE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("VALVEFUNCTION", objs[12]==null?"":objs[12].toString());
		jsonobj.put("DRIVETYPE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("PRESSUREGRADE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("SEALWAY", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ISREDUCING", objs[16]==null?"":objs[16].toString());
		jsonobj.put("INCONNECTTYPE", objs[17]==null?"":objs[17].toString());
		jsonobj.put("INDIAMETER", objs[18]==null?"":objs[18].toString());
		jsonobj.put("OUTCONNECTTYPE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("OUTDIAMETER", objs[20]==null?"":objs[20].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[21]==null?"":objs[21].toString());
		jsonobj.put("REMARK", objs[22]==null?"":objs[22].toString());
		jsonobj.put("PIPELINENO", objs[23]==null?"":objs[23].toString());
		jsonobj.put("MANAGEDEPARTMENT", objs[24]==null?"":objs[24].toString());
		jsonobj.put("MANAGEUNIT", objs[25]==null?"":objs[25].toString());
		String codeid=objs[26]==null?"":objs[26].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[27]==null?"":objs[27].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		jsonobj.put("VALVEPITNO", objs[28]==null?"":objs[28].toString());
		out.print(jsonobj.toString());
	}
	
	//获取站箱信息
	public void getZhanxiang() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select STATIONNO,PIPENO,PROJECTNO,DEVICECODE," +
				"STATIONNAME,STATIONTYPE,LOCATIONNO,MANAGEUNIT," +
				"MANAGEDEPARTMENT,LOCATIONDESCRIPTION,LOCATIONY," +
				"LOCATIONX,PRESSURELEVEL,PIPELINENO,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,REMARK,ATTACHMENT," +
				"PHOTO from PTEM_STATION";
		//sql+=" where STATIONNO='"+id+"'";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("STATIONNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PROJECTNO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("DEVICECODE", objs[3]==null?"":objs[3].toString());
		jsonobj.put("STATIONNAME", objs[4]==null?"":objs[4].toString());
		jsonobj.put("STATIONTYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONNO", objs[6]==null?"":objs[6].toString());
		jsonobj.put("MANAGEUNIT", objs[7]==null?"":objs[7].toString());		
		jsonobj.put("MANAGEDEPARTMENT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LOCATIONY", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONX", objs[11]==null?"":objs[11].toString());
		jsonobj.put("PRESSURELEVEL", objs[12]==null?"":objs[12].toString());		
		jsonobj.put("PIPELINENO", objs[13]==null?"":objs[13].toString());
		jsonobj.put("HEIGHT", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LONGITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("LATITUDE", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("ELLIPSEH", objs[17]==null?"":objs[17].toString());		
		jsonobj.put("REMARK", objs[18]==null?"":objs[18].toString());		
		String codeid=objs[19]==null?"":objs[19].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[20]==null?"":objs[20].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}	
	//获取过滤器信息
	public void getGuolvqi() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select PIPENETNO,STATIONNAME,LOCATIONNO,FILTERNO," +
				"FILTERNAME,USEPERMITNO,DEVICEREGISTERCODE,DEVICEREGISTERSTATUS," +
				"TYPE,DEVICESTATUS,MANAGEUNIT,MANAGEDEPARTMENT,CONTAINERWEIGHT," +
				"VOLUME,TUBEWALLTHICKNESS,HEADWALLTHICKNESS,DIAMETER,LENGTH," +
				"MATERIAL,DESIGNPRESSURE,MAXWORKPRESSURE,TESTPRESSURE," +				
				"DESIGNTEMPERATURE,MEDIA,DESIGNUNIT,MANUFACTURER,INSTALLUNIT," +
				"MANUFACTUREDATE,STARTUSEDATE,OWNDISTRICT," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"REMARK,PIPELINENO,ATTACHMENT,PHOTO from  PTEM_FILTER";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENETNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("STATIONNAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONNO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("FILTERNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("FILTERNAME", objs[4]==null?"":objs[4].toString());
		jsonobj.put("USEPERMITNO", objs[5]==null?"":objs[5].toString());
		jsonobj.put("DEVICEREGISTERCODE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("DEVICEREGISTERSTATUS", objs[7]==null?"":objs[7].toString());
		
		jsonobj.put("TYPE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("DEVICESTATUS", objs[9]==null?"":objs[9].toString());
		jsonobj.put("MANAGEUNIT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("MANAGEDEPARTMENT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("CONTAINERWEIGHT", objs[12]==null?"":objs[12].toString());
		
		jsonobj.put("VOLUME", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TUBEWALLTHICKNESS", objs[14]==null?"":objs[14].toString());
		jsonobj.put("HEADWALLTHICKNESS", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DIAMETER", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("LENGTH", objs[17]==null?"":objs[17].toString());
		
		jsonobj.put("MATERIAL", objs[18]==null?"":objs[18].toString());
		jsonobj.put("DESIGNPRESSURE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("MAXWORKPRESSURE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("TESTPRESSURE", objs[21]==null?"":objs[21].toString());
		
		jsonobj.put("DESIGNTEMPERATURE", objs[22]==null?"":objs[22].toString());
		jsonobj.put("MEDIA", objs[23]==null?"":objs[23].toString());
		jsonobj.put("DESIGNUNIT", objs[24]==null?"":objs[24].toString());
		jsonobj.put("MANUFACTURER", objs[25]==null?"":objs[25].toString());
		jsonobj.put("INSTALLUNIT", objs[26]==null?"":objs[26].toString());
		
		jsonobj.put("MANUFACTUREDATE", objs[27]==null?"":objs[27].toString());
		jsonobj.put("STARTUSEDATE", objs[28]==null?"":objs[28].toString());
		jsonobj.put("OWNDISTRICT", objs[29]==null?"":objs[29].toString());
		
		jsonobj.put("LOCATIONY", objs[30]==null?"":objs[30].toString());
		jsonobj.put("LOCATIONX", objs[31]==null?"":objs[31].toString());
		jsonobj.put("HEIGHT", objs[32]==null?"":objs[32].toString());
		jsonobj.put("LONGITUDE", objs[33]==null?"":objs[33].toString());
		jsonobj.put("LATITUDE", objs[34]==null?"":objs[34].toString());
		jsonobj.put("ELLIPSEH", objs[35]==null?"":objs[35].toString());
		
		jsonobj.put("REMARK", objs[36]==null?"":objs[36].toString());
		jsonobj.put("PIPELINENO", objs[37]==null?"":objs[37].toString());
		
		String codeid=objs[38]==null?"":objs[38].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[39]==null?"":objs[39].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}	
	//获取安全阀信息
	public void getAnquanfa() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select PIPENETNO,STATIONNAME,DEVICECODE," +
				"SAFETYVALVEMODEL,NOMINALDIAMETER,SAFETYVALVETYPE," +
				"PRESSURECLASSRANGE,MANUFACTURER,LICENSENO,FACTORYDATE," +
				"MANAGEUNIT,MANAGEDEPARMENT,REMARK,PIPELINENO,ATTACHMENT,PHOTO " +
				"from  PTEM_SAFETYVALVE";
		sql+=" where SAFETYVALVENO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENETNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("STATIONNAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("DEVICECODE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("SAFETYVALVEMODEL", objs[3]==null?"":objs[3].toString());
		jsonobj.put("NOMINALDIAMETER", objs[4]==null?"":objs[4].toString());
		jsonobj.put("SAFETYVALVETYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("PRESSURECLASSRANGE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("MANUFACTURER", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LICENSENO", objs[8]==null?"":objs[8].toString());
		jsonobj.put("FACTORYDATE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("MANAGEUNIT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("MANAGEDEPARMENT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("REMARK", objs[12]==null?"":objs[12].toString());
		jsonobj.put("PIPELINENO", objs[13]==null?"":objs[13].toString());	
		String codeid=objs[14]==null?"":objs[14].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[15]==null?"":objs[15].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取异常信息	
	public void getYichang() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");		
		String sql="select EXCEPTIONTYPE,DESCRIPTION," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"FOUNDTIME,PIPELINENO,PIPESECTIONNO,ATTACHMENT " +
				"from PTEM_EXCEPTION";
		sql+=" where EXCEPTIONNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("EXCEPTIONTYPE", objs[0]==null?"":objs[0].toString());
		jsonobj.put("DESCRIPTION", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONY", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONX", objs[3]==null?"":objs[3].toString());
		jsonobj.put("HEIGHT", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LONGITUDE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LATITUDE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("ELLIPSEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("FOUNDTIME", objs[8]==null?"":objs[8].toString());
		jsonobj.put("PIPELINENO", objs[9]==null?"":objs[9].toString());
		jsonobj.put("PIPESECTIONNO", objs[10]==null?"":objs[10].toString());		
		String codeid=objs[11]==null?"":objs[11].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取特殊段信息	
	public void getTeshuduan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select PIPESECTIONNO,SPECIALNAME,SPECIALTYPE," +
				"OTHER,GRADING,BEGINNODEY,BEGINNODEX,BEGINNODEH," +
				"BEGINNODEL,BEGINNODEB,BEGINNODEELLPSEH," +
				"ENDNODEY,ENDNODEX,ENDNODEH,ENDNODEL,ENDNODEB," +
				"ENDENODEELLIPSEH,REMARK,PROJECTNO,PIPELINENO," +
				"ATTACHMENT,PHOTO from PTEM_SPECIAL";
		sql+=" where SPECIALNO='"+id+"'";	
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPESECTIONNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("SPECIALNAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("SPECIALTYPE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("OTHER", objs[3]==null?"":objs[3].toString());
		jsonobj.put("GRADING", objs[4]==null?"":objs[4].toString());
		jsonobj.put("BEGINNODEY", objs[5]==null?"":objs[5].toString());
		jsonobj.put("BEGINNODEX", objs[6]==null?"":objs[6].toString());
		jsonobj.put("BEGINNODEH", objs[7]==null?"":objs[7].toString());
		jsonobj.put("BEGINNODEL", objs[8]==null?"":objs[8].toString());
		jsonobj.put("BEGINNODEB", objs[9]==null?"":objs[9].toString());
		jsonobj.put("BEGINNODEELLPSEH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ENDNODEY", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ENDNODEX", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ENDNODEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ENDNODEL", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ENDNODEB", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ENDENODEELLIPSEH", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("REMARK", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("PROJECTNO", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("PIPELINENO", objs[19]==null?"":objs[19].toString());		
		String codeid=objs[20]==null?"":objs[20].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[21]==null?"":objs[21].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	//获取违章占压信息	
	public void getWeizhangzhanya() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select VIOLATOR,OCCURTIME,VIOLATIONFORM,NATURE," +
				"ISSEDIMENTATION,LOCATIONDESCRIPTION," +
				"LOCATIONY,LOCATIONX,LOCATIONH,LONGITUDE,LATITUDE," +
				"LOCATIONELLIPSEH,PIPELINELENGTH,DISTANCE,STATE," +
				"SAFETYLEVEL,PIPELINENO,PIPESECTIONNO,REMARK,PHOTO" +
				" from  PTEM_VIOLATION";
		sql+=" where VIOLATIONNO='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("VIOLATOR", objs[0]==null?"":objs[0].toString());
		jsonobj.put("OCCURTIME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("VIOLATIONFORM", objs[2]==null?"":objs[2].toString());
		jsonobj.put("NATURE", objs[3]==null?"":objs[3].toString());
		jsonobj.put("ISSEDIMENTATION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONH", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("PIPELINELENGTH", objs[12]==null?"":objs[12].toString());
		jsonobj.put("DISTANCE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("STATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("SAFETYLEVEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("PIPELINENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("PIPESECTIONNO", objs[17]==null?"":objs[17].toString());
		jsonobj.put("REMARK", objs[18]==null?"":objs[18].toString());
//		String codeid="";
//		String filepath="";
//		String filename="";
		String codeid=objs[19]==null?"":objs[19].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[19]==null?"":objs[19].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	
	//获取生产作业点信息	
	public void getShengchanzuoyedian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select t1.PIPENO,t1.LOCATIONY,t1.LOCATIONX,t1.HEIGHT," +
				"t1.LONGITUDE,t1.LATITUDE,t1.ELLIPSEH," +
				"t2.EVENTNO,t2.LOCATIONNO,t2.OCCURETIME,t2.CONTENT," +
				"t2.ISSOILTEST,t2.ISCOATINGTEST,t2.ISWELD," +
				"t2.ISREPLACEDPIPENO,t2.ATTACHMENT,t2.PHOTO " +
				"from PTEM_OPERATIONS_DATA t1,PTEM_OPERATIONS t2 " +
				"where t1.PARENTID=t2.ID";
		//sql+=" and t1.pipeno='"+id+"'";
		sql+=" and t1.id='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("PIPENO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("LOCATIONY", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LOCATIONX", objs[2]==null?"":objs[2].toString());
		jsonobj.put("HEIGHT", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LONGITUDE", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LATITUDE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("ELLIPSEH", objs[6]==null?"":objs[6].toString());
		jsonobj.put("EVENTNO", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONNO", objs[8]==null?"":objs[8].toString());
		jsonobj.put("OCCURETIME", objs[9]==null?"":objs[9].toString());
		jsonobj.put("CONTENT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ISSOILTEST", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ISCOATINGTEST", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ISWELD", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ISREPLACEDPIPENO", objs[14]==null?"":objs[14].toString());
		String codeid=objs[15]==null?"":objs[15].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[16]==null?"":objs[16].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取带气作业机械预制件信息	
	public void getDaiqizuoyejixieyuzhijian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select EVENTNO,PIPELINENO,PIPENO,TYPE," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE," +
				"ELLIPSEH,REMARK from PTEM_FITTING";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("EVENTNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("TYPE", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONY", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONX", objs[5]==null?"":objs[5].toString());
		jsonobj.put("HEIGHT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LONGITUDE", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LATITUDE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ELLIPSEH", objs[9]==null?"":objs[9].toString());
		jsonobj.put("REMARK", objs[10]==null?"":objs[10].toString());
		out.print(jsonobj.toString());
	}
	
	//获取事件点信息	
	public void getShijiandian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select t1.LOCATIONY,t1.LOCATIONX,t1.LONGITUDE,t1.LATITUDE," +
				"t1.ELLIPSEH,t1.HEIGHT,t2.EVENTNO,t2.OCCURETIME,t2.EVENTCONTENT," +
				"t2.REASONCLASSIFY,t2.REASONANALY,t2.EVENTLEVEL,t2.RESULT," +
				"t2.ISSOILTEST,t2.ISCOATIONTEST,t2.ISWELD,t2.ATTACHMENT," +
				"t2.PHOTO,t1.PIPENO from PTEM_EMERGENCY_DATA t1,PTEM_EMERGENCY t2 " +
				"where t1.PARENTID=t2.ID ";
		sql+=" and t1.id='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("LOCATIONY", objs[0]==null?"":objs[0].toString());
		jsonobj.put("LOCATIONX", objs[1]==null?"":objs[1].toString());
		jsonobj.put("LONGITUDE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LATITUDE", objs[3]==null?"":objs[3].toString());
		jsonobj.put("ELLIPSEH", objs[4]==null?"":objs[4].toString());
		jsonobj.put("HEIGHT", objs[5]==null?"":objs[5].toString());
		jsonobj.put("EVENTNO", objs[6]==null?"":objs[6].toString());
		jsonobj.put("OCCURETIME", objs[7]==null?"":objs[7].toString());
		jsonobj.put("EVENTCONTENT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REASONCLASSIFY", objs[9]==null?"":objs[9].toString());
		jsonobj.put("REASONANALY", objs[10]==null?"":objs[10].toString());
		jsonobj.put("EVENTLEVEL", objs[11]==null?"":objs[11].toString());
		jsonobj.put("RESULT", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ISSOILTEST", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ISCOATIONTEST", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ISWELD", objs[15]==null?"":objs[15].toString());	
		String codeid=objs[16]==null?"":objs[16].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[17]==null?"":objs[17].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		jsonobj.put("PIPENO", objs[18]==null?"":objs[18].toString());
		out.print(jsonobj.toString());
	}
	/////////////////////////////////////
	//获取泄漏点信息
	public void getXieloudian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select EVENNO,TASKNO,PIPELINENO,PIPENO," +
				"LOCATIONDESCRIBE,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,LEAKREASON,DESCRIPTION," +
				"LEAKPPM,LEAKVOL,MANAGEUNIT,MANAGEDEPARTMENT,ISREPAIR," +
				"REPAIRWAY,TESTRESULT,TESTUNIT,TESTER,TESTDATE,REMARK," +
				"ATTACHMENT from PTEM_LEAKPOINT";
		sql+=" where id='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("EVENNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("TASKNO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPELINENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("PIPENO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIBE", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONY", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONX", objs[6]==null?"":objs[6].toString());
		jsonobj.put("HEIGHT", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LONGITUDE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LATITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("ELLIPSEH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LEAKREASON", objs[11]==null?"":objs[11].toString());
		jsonobj.put("DESCRIPTION", objs[12]==null?"":objs[12].toString());
		jsonobj.put("LEAKPPM", objs[13]==null?"":objs[13].toString());
		jsonobj.put("LEAKVOL", objs[14]==null?"":objs[14].toString());
		jsonobj.put("MANAGEUNIT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("MANAGEDEPARTMENT", objs[16]==null?"":objs[16].toString());
		jsonobj.put("ISREPAIR", objs[17]==null?"":objs[17].toString());
		jsonobj.put("REPAIRWAY", objs[18]==null?"":objs[18].toString());
		jsonobj.put("TESTRESULT", objs[19]==null?"":objs[19].toString());
		jsonobj.put("TESTUNIT", objs[20]==null?"":objs[20].toString());
		jsonobj.put("TESTER", objs[21]==null?"":objs[21].toString());
		jsonobj.put("TESTDATE", objs[22]==null?"":objs[22].toString());
		jsonobj.put("REMARK", objs[23]==null?"":objs[23].toString());
		String codeid=objs[24]==null?"":objs[24].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取特征点检查信息
	public void getTezhengdianjiancha() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,POINTNO,POINTNAME," +
				"TYPE,LOCATIONY,LOCATIONX,GROUNDMARK,REMARK,TESTDATE," +
				"TESTUNIT,TESTER,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH,PHOTO" +
				" from  PTEM_POINT_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("POINTNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("POINTNAME", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("GROUNDMARK", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REMARK", objs[9]==null?"":objs[9].toString());
		jsonobj.put("TESTDATE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("TESTUNIT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTER", objs[12]==null?"":objs[12].toString());
		jsonobj.put("HEIGHT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("LONGITUDE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LATITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ELLIPSEH", objs[16]==null?"":objs[16].toString());	
		String codeid=objs[17]==null?"":objs[17].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取穿越检查信息
	public void getChuanyuejiancha() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,CROSSINGNO,CROSSINGINFO," +
				"CROSSINGTYPE,OBJECTTYPE,CROSSINGWAY,DESCRIPTION," +
				"CASINGSTANDARD,CROSSINGLENGTH,CHECKHOLE,GROUNDANDOTHER," +
				"TESTER,VERIFIER,TESTDATE,LONGITUDE,LATITUDE,HEIGHT," +
				"ATTACHMENT from  PTEM_CROSSING_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("CROSSINGNO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("CROSSINGINFO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("CROSSINGTYPE", objs[4]==null?"":objs[4].toString());
		jsonobj.put("OBJECTTYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("CROSSINGWAY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("DESCRIPTION", objs[7]==null?"":objs[7].toString());
		jsonobj.put("CASINGSTANDARD", objs[8]==null?"":objs[8].toString());
		jsonobj.put("CROSSINGLENGTH", objs[9]==null?"":objs[9].toString());
		jsonobj.put("CHECKHOLE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("GROUNDANDOTHER", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTER", objs[12]==null?"":objs[12].toString());
		jsonobj.put("VERIFIER", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LONGITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("LATITUDE", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("HEIGHT", objs[17]==null?"":objs[17].toString());	
		String codeid=objs[18]==null?"":objs[18].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取外观检查信息
	public void getWaiguanjiancha() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO,LOCATIONDESCRIPTION," +
				"TYPE,OUTERDIAMETER,THICKNESS,MATERIALMARK,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER,LEAKCHECK," +
				"VIBRATECHECK,LOCATIONANDDEFORMATION,SUPPORTSANDHANGERS,VALVE,FLANGE," +
				"EXPANSIONJOINT,COATING,WELDEDJOINT,CORROSIONCHECK,WATERSITUATION," +
				"HUMIDITY,REMARK,ATTACHMENT,PHOTOS,PIPELINEGRAPH";
		sql+=" from PTEM_APPERANCE_CHECK where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("THICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("MATERIALMARK", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONY", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LOCATIONX", objs[10]==null?"":objs[10].toString());
		jsonobj.put("HEIGHT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LONGITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("LATITUDE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ELLIPSEH", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTDATE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTUNIT", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("TESTER", objs[17]==null?"":objs[17].toString());
		jsonobj.put("LEAKCHECK", objs[18]==null?"":objs[18].toString());
		jsonobj.put("VIBRATECHECK", objs[19]==null?"":objs[19].toString());
		jsonobj.put("LOCATIONANDDEFORMATION", objs[20]==null?"":objs[20].toString());
		jsonobj.put("SUPPORTSANDHANGERS", objs[21]==null?"":objs[21].toString());
		jsonobj.put("VALVE", objs[22]==null?"":objs[22].toString());
		jsonobj.put("FLANGE", objs[23]==null?"":objs[23].toString());
		jsonobj.put("EXPANSIONJOINT", objs[24]==null?"":objs[24].toString());
		jsonobj.put("COATING", objs[25]==null?"":objs[25].toString());
		jsonobj.put("WELDEDJOINT", objs[26]==null?"":objs[26].toString());
		jsonobj.put("CORROSIONCHECK", objs[27]==null?"":objs[27].toString());
		jsonobj.put("WATERSITUATION", objs[28]==null?"":objs[28].toString());
		jsonobj.put("HUMIDITY", objs[29]==null?"":objs[29].toString());
		jsonobj.put("REMARK", objs[30]==null?"":objs[30].toString());

		String codeid=objs[31]==null?"":objs[31].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		
		codeid=objs[32]==null?"":objs[32].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		
		codeid=objs[33]==null?"":objs[33].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("pipelinegraphpath",filepath);
		jsonobj.put("pipelinegraphname",filename);
		
		out.print(jsonobj.toString());
	}
	//获取壁厚检测信息
	public void getBihoujiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select t1.TASKNO,t1.PIPELINENO,t1.PIPENO,t1.LOCATIONNO," +
				"t1.TESTLOCATION,t1.TESTTYPE,t1.OUTERDIAMETER,t1.THICKNESS," +
				"t1.SURFACESITUATION,t1.LOCATIONY,t1.LOCATIONX,t1.HEIGHT," +
				"t1.LONGITUDE,t1.LATITUDE,t1.ELLIPSEH,t1.TESTDATE,t1.TESTUNIT," +
				"t1.TESTER,t1.DEVICENAMEMODEL,t1.DEVICENO,t1.DEVICEACCURACY," +
				"t1.COUPLANT,t1.TESTRESULT,t1.REMARK,t1.TESTPOINTGRAPH " +
				" from  PTEM_WALLTHICKNESS t1";		
		sql+=" where t1.ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("TESTLOCATION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TESTTYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("THICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("SURFACESITUATION", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONY", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LOCATIONX", objs[10]==null?"":objs[10].toString());
		jsonobj.put("HEIGHT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LONGITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("LATITUDE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ELLIPSEH", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTDATE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTUNIT", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("TESTER", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("DEVICENAMEMODEL", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("DEVICENO", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("DEVICEACCURACY", objs[20]==null?"":objs[20].toString());	
		jsonobj.put("COUPLANT", objs[21]==null?"":objs[21].toString());	
		jsonobj.put("TESTRESULT", objs[22]==null?"":objs[22].toString());	
		jsonobj.put("REMARK", objs[23]==null?"":objs[23].toString());	
		String codeid=objs[24]==null?"":objs[24].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取防腐层厚度检测信息
	public void getFangfucenghoudujiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,CHECKTYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"GROUNDSITUATION,COATINGTYPE,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER," +
				"DEVICENAME,DEVICENO,DEVICEACCURENCE,TESTPOINTGROUPH " +
				"from  PTEM_COATINGTHICKNESS";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("CHECKTYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("GROUNDSITUATION", objs[8]==null?"":objs[8].toString());
		jsonobj.put("COATINGTYPE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LOCATIONY", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONX", objs[11]==null?"":objs[11].toString());
		jsonobj.put("HEIGHT", objs[12]==null?"":objs[12].toString());
		jsonobj.put("LONGITUDE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("LATITUDE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ELLIPSEH", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTDATE", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTUNIT", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("TESTER", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("DEVICENAME", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("DEVICENO", objs[20]==null?"":objs[20].toString());	
		jsonobj.put("DEVICEACCURENCE", objs[21]==null?"":objs[21].toString());	
		String codeid=objs[22]==null?"":objs[22].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取防腐层破损检测信息
	public void getFangfucengposunjiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"GROUNDSITUATION,COATINGTYPE,COATINGTHICKNESS,LOCATIONY," +
				"LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH,TESTVOLTAGE," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO," +
				"EXCUTESTANDARD,DAMAGEDPOINTNO,DAMAGEEDPOINLOCATION," +
				"REMARK,PHOTO,DAMAGEDPOINTGRAPH from PTEM_COATINGDAMAGED_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("GROUNDSITUATION", objs[8]==null?"":objs[8].toString());
		jsonobj.put("COATINGTYPE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("COATINGTHICKNESS", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONY", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LOCATIONX", objs[12]==null?"":objs[12].toString());
		jsonobj.put("HEIGHT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("LONGITUDE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LATITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ELLIPSEH", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("TESTVOLTAGE", objs[17]==null?"":objs[17].toString());
		jsonobj.put("TESTDATE", objs[18]==null?"":objs[18].toString());
		jsonobj.put("TESTUNIT", objs[19]==null?"":objs[19].toString());
		jsonobj.put("TESTER", objs[20]==null?"":objs[20].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[21]==null?"":objs[21].toString());
		jsonobj.put("DEVICENO", objs[22]==null?"":objs[22].toString());
		jsonobj.put("EXCUTESTANDARD", objs[23]==null?"":objs[23].toString());
		jsonobj.put("DAMAGEDPOINTNO", objs[24]==null?"":objs[24].toString());
		jsonobj.put("DAMAGEEDPOINLOCATION", objs[25]==null?"":objs[25].toString());
		jsonobj.put("REMARK", objs[26]==null?"":objs[26].toString());
		String codeid=objs[27]==null?"":objs[27].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[28]==null?"":objs[28].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取腐蚀状况检测信息
	public void getFushizhuangkuangjiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO," +
				"DEVICEACCURENCE,COUPLANT,EXCUTESTANDARD,PRODUCTLOCATION," +
				"PRODUCTCOLOR,PRODUCTSTRUCTURE,PRODUCTCOMPACTNESS,PRODUCTTYPE," +
				"PRODUCTSHAPE,CORROSIONPITNO,DESIGNTHICKNESS,MINTHICKNESS," +
				"MAXDEPTH,REMARK,CORROSIONPHOTO from  PTEM_CORROSION_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("HEIGHT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LONGITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LATITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTUNIT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTER", objs[16]==null?"":objs[16].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[17]==null?"":objs[17].toString());
		jsonobj.put("DEVICENO", objs[18]==null?"":objs[18].toString());
		jsonobj.put("DEVICEACCURENCE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("COUPLANT", objs[20]==null?"":objs[20].toString());
		jsonobj.put("EXCUTESTANDARD", objs[21]==null?"":objs[21].toString());
		jsonobj.put("PRODUCTLOCATION", objs[22]==null?"":objs[22].toString());
		jsonobj.put("PRODUCTCOLOR", objs[23]==null?"":objs[23].toString());
		jsonobj.put("PRODUCTSTRUCTURE", objs[24]==null?"":objs[24].toString());
		jsonobj.put("PRODUCTCOMPACTNESS", objs[25]==null?"":objs[25].toString());
		jsonobj.put("PRODUCTTYPE", objs[26]==null?"":objs[26].toString());
		jsonobj.put("PRODUCTSHAPE", objs[27]==null?"":objs[27].toString());
		jsonobj.put("CORROSIONPITNO", objs[28]==null?"":objs[28].toString());
		jsonobj.put("DESIGNTHICKNESS", objs[29]==null?"":objs[29].toString());
		jsonobj.put("MINTHICKNESS", objs[30]==null?"":objs[30].toString());
		jsonobj.put("MAXDEPTH", objs[31]==null?"":objs[31].toString());
		jsonobj.put("REMARK", objs[32]==null?"":objs[32].toString());
		String codeid=objs[33]==null?"":objs[33].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取射线检测信息
	public void getShexianjiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TESTTYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,OPERATIONCARDNO,DEVICENAMEMODEL," +
				"DEIVICENO,SOURCETYPE,INTENSIFYWAY,FOCALDISTANCE,ENERGY," +
				"CURRENTSOURCEACTIVITY,IQIMODEL,IQIINDEX,TRANSILLUMINATEMODE," +
				"EXPOSINGTIME,FOCUSSIZE,FILMDENSITY,FILMSIZE,FILMMARK," +
				"TESTLENGTH,TRANSILLUMINATIONLENTHT,TRANSILLUMINATELENGTH," +
				"TESTRESULT,GRAPH,RADIOGRAPHIC from PTEM_RADIAL";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TESTTYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("HEIGHT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LONGITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LATITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTUNIT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTER", objs[16]==null?"":objs[16].toString());
		jsonobj.put("OPERATIONCARDNO", objs[17]==null?"":objs[17].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[18]==null?"":objs[18].toString());
		jsonobj.put("DEIVICENO", objs[19]==null?"":objs[19].toString());
		jsonobj.put("SOURCETYPE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("INTENSIFYWAY", objs[21]==null?"":objs[21].toString());
		jsonobj.put("FOCALDISTANCE", objs[22]==null?"":objs[22].toString());
		jsonobj.put("ENERGY", objs[23]==null?"":objs[23].toString());
		jsonobj.put("CURRENTSOURCEACTIVITY", objs[24]==null?"":objs[24].toString());
		jsonobj.put("IQIMODEL", objs[25]==null?"":objs[25].toString());
		jsonobj.put("IQIINDEX", objs[26]==null?"":objs[26].toString());
		jsonobj.put("TRANSILLUMINATEMODE", objs[27]==null?"":objs[27].toString());
		jsonobj.put("EXPOSINGTIME", objs[28]==null?"":objs[28].toString());
		jsonobj.put("FOCUSSIZE", objs[29]==null?"":objs[29].toString());
		jsonobj.put("FILMDENSITY", objs[30]==null?"":objs[30].toString());
		jsonobj.put("FILMSIZE", objs[31]==null?"":objs[31].toString());
		jsonobj.put("FILMMARK", objs[32]==null?"":objs[32].toString());
		jsonobj.put("TESTLENGTH", objs[33]==null?"":objs[33].toString());
		jsonobj.put("TRANSILLUMINATIONLENTHT", objs[34]==null?"":objs[34].toString());
		jsonobj.put("TRANSILLUMINATELENGTH", objs[35]==null?"":objs[35].toString());
		jsonobj.put("TESTRESULT", objs[36]==null?"":objs[36].toString());
		String codeid=objs[37]==null?"":objs[37].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[38]==null?"":objs[38].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	//获取导波检测信息
	public void getDaobojiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO,PROBENO," +
				"TESTMETHOD,SERIALNO,TESTRESULT,ATTACHMENT from PTEM_GUIDEDWAVES_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("HEIGHT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LONGITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LATITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTUNIT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTER", objs[16]==null?"":objs[16].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[17]==null?"":objs[17].toString());
		jsonobj.put("DEVICENO", objs[18]==null?"":objs[18].toString());
		jsonobj.put("PROBENO", objs[19]==null?"":objs[19].toString());
		jsonobj.put("TESTMETHOD", objs[20]==null?"":objs[20].toString());
		jsonobj.put("SERIALNO", objs[21]==null?"":objs[21].toString());
		jsonobj.put("TESTRESULT", objs[22]==null?"":objs[22].toString());
		String codeid=objs[23]==null?"":objs[23].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取磁记忆检测信息
	public void getCijiyijiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"MATERIALMARK,LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE," +
				"LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL," +
				"DEVICENO,PROBEMODEL,CALIBRATION,REMARK,TESTPOINTNO," +
				"TESTLOCATION,TESTRESULT,ATTACHMENT,TESTDATAGRAPH,DIAGRAM " +
				"from PTEM_MAGNETIC_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("MATERIALMARK", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONY", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LOCATIONX", objs[10]==null?"":objs[10].toString());
		jsonobj.put("HEIGHT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LONGITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("LATITUDE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ELLIPSEH", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTDATE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTUNIT", objs[16]==null?"":objs[16].toString());	
		jsonobj.put("TESTER", objs[17]==null?"":objs[17].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[18]==null?"":objs[18].toString());
		jsonobj.put("DEVICENO", objs[19]==null?"":objs[19].toString());
		jsonobj.put("PROBEMODEL", objs[20]==null?"":objs[20].toString());
		jsonobj.put("CALIBRATION", objs[21]==null?"":objs[21].toString());
		jsonobj.put("REMARK", objs[22]==null?"":objs[22].toString());
		jsonobj.put("TESTPOINTNO", objs[23]==null?"":objs[23].toString());
		jsonobj.put("TESTLOCATION", objs[24]==null?"":objs[24].toString());
		jsonobj.put("TESTRESULT", objs[25]==null?"":objs[25].toString());
		String codeid=objs[26]==null?"":objs[26].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[27]==null?"":objs[27].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		codeid=objs[28]==null?"":objs[28].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("diagrampath",filepath);
		jsonobj.put("diagramname",filename);
		out.print(jsonobj.toString());
	}
	//获取瞬变电磁检测信息
	public void getShunbiandiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONDESCRIPTION," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO," +
				"TESTPOINTDISTANCE,TESTMETHOD,EVALUATESTANDARD," +
				"TESTRESULT,ATTACHMENT from PTEM_TDEM_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONY", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONX", objs[5]==null?"":objs[5].toString());
		jsonobj.put("HEIGHT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LONGITUDE", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LATITUDE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("ELLIPSEH", objs[9]==null?"":objs[9].toString());
		jsonobj.put("TESTDATE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("TESTUNIT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTER", objs[12]==null?"":objs[12].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[13]==null?"":objs[13].toString());
		jsonobj.put("DEVICENO", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTPOINTDISTANCE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTMETHOD", objs[16]==null?"":objs[16].toString());
		jsonobj.put("EVALUATESTANDARD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("TESTRESULT", objs[18]==null?"":objs[18].toString());
		String codeid=objs[19]==null?"":objs[19].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取应力试验信息
	public void getYinglishiyan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,OUTERDIAMETER,WALLTHICKNESS," +
				"LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO," +
				"TESTMETHOD,SAMPLETYPE,EXCUTESTANDARD,TESTRESULT,ATTACHMENT" +
				" from PTEM_REMAININGSTRESS";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("OUTERDIAMETER", objs[6]==null?"":objs[6].toString());
		jsonobj.put("WALLTHICKNESS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONY", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LOCATIONX", objs[9]==null?"":objs[9].toString());
		jsonobj.put("HEIGHT", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LONGITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LATITUDE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ELLIPSEH", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTDATE", objs[14]==null?"":objs[14].toString());
		jsonobj.put("TESTUNIT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTER", objs[16]==null?"":objs[16].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[17]==null?"":objs[17].toString());
		jsonobj.put("DEVICENO", objs[18]==null?"":objs[18].toString());
		jsonobj.put("TESTMETHOD", objs[19]==null?"":objs[19].toString());
		jsonobj.put("SAMPLETYPE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("EXCUTESTANDARD", objs[21]==null?"":objs[21].toString());
		jsonobj.put("TESTRESULT", objs[22]==null?"":objs[22].toString());
		String codeid=objs[23]==null?"":objs[23].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取化学成分分析信息
	public void getHuaxuechengfenfenxi() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,LOCATIONY,LOCATIONX," +
				"HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE," +
				"TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO," +
				"TESTMETHOD,GROUNDSTATUS,EXCUTESTANDARD,TESTRESULT," +
				"ATTACHMENT from PTEM_CHEMICAL";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("GROUNDSTATUS", objs[18]==null?"":objs[18].toString());
		jsonobj.put("EXCUTESTANDARD", objs[19]==null?"":objs[19].toString());
		jsonobj.put("TESTRESULT", objs[20]==null?"":objs[20].toString());
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取硬度测试信息
	public void getYingduceshi() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO,LOCATIONDESCRIPTION," +
				"TYPE,LOCATIONY,LOCATIONX,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH," +
				"TESTDATE,TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO,TESTMETHOD," +
				"GROUNDSTATUS,EXCUTESTANDARD,TESTRESULT,ATTACHMENT,GRAPH " +
				"from PTEM_HARDNESS";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("GROUNDSTATUS", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("EXCUTESTANDARD", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("TESTRESULT", objs[20]==null?"":objs[20].toString());	
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[22]==null?"":objs[22].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取金相分析信息
	public void getJinxiangfenxi() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER," +
				"DEVICENAMEMODEL,DEVICENO,TESTMETHOD,MATERIALMARK," +
				"HEATTREATMENTSTATUS,POLISHWAY,CROSSIONMETHOD," +
				"EXCUTESTANDARD,TESTRESULT,ATTACHMENT,METALLOGRAPHICALPHOTO" +
				" from PTEM_METALLOGRAPHIC";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("MATERIALMARK", objs[18]==null?"":objs[18].toString());
		jsonobj.put("HEATTREATMENTSTATUS", objs[19]==null?"":objs[19].toString());
		jsonobj.put("POLISHWAY", objs[20]==null?"":objs[20].toString());	
		jsonobj.put("CROSSIONMETHOD", objs[21]==null?"":objs[21].toString());
		jsonobj.put("EXCUTESTANDARD", objs[22]==null?"":objs[22].toString());
		jsonobj.put("TESTRESULT", objs[23]==null?"":objs[23].toString());
		String codeid=objs[24]==null?"":objs[24].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[25]==null?"":objs[25].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取拉伸试验信息
	public void getLashenshiyan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER," +
				"DEVICENAMEMODEL,DEVICENO,TESTMETHOD,SAMPLETYPE," +
				"EXCUTESTANDARD,TESTRESULT,ATTACHMENT from PTEM_STRETCH";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("SAMPLETYPE", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("EXCUTESTANDARD", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("TESTRESULT", objs[20]==null?"":objs[20].toString());		
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取弯曲试验信息
	public void getWanqushiyan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,LOCATIONY,LOCATIONX,HEIGHT," +
				"LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT,TESTER," +
				"DEVICENAMEMODEL,DEVICENO,TESTMETHOD,SAMPLETYPE," +
				"EXCUTESTANDARD,TESTRESULT,ATTACHMENT " +
				"from  PTEM_BEND";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("SAMPLETYPE", objs[18]==null?"":objs[18].toString());
		jsonobj.put("EXCUTESTANDARD", objs[19]==null?"":objs[19].toString());
		jsonobj.put("TESTRESULT", objs[20]==null?"":objs[20].toString());
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取冲击试验信息
	public void getChongjishiyan() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPELINENO,PIPENO,LOCATIONNO," +
				"LOCATIONDESCRIPTION,TYPE,LOCATIONY,LOCATIONX," +
				"HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE," +
				"TESTUNIT,TESTER,DEVICENAMEMODEL,DEVICENO,TESTMETHOD," +
				"SAMPLETYPE,EXCUTESTANDARD,TESTRESULT,ATTACHMENT " +
				"from PTEM_SHOCK";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONNO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TYPE", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONY", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONX", objs[7]==null?"":objs[7].toString());
		jsonobj.put("HEIGHT", objs[8]==null?"":objs[8].toString());
		jsonobj.put("LONGITUDE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LATITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ELLIPSEH", objs[11]==null?"":objs[11].toString());
		jsonobj.put("TESTDATE", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTUNIT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENO", objs[16]==null?"":objs[16].toString());
		jsonobj.put("TESTMETHOD", objs[17]==null?"":objs[17].toString());
		jsonobj.put("SAMPLETYPE", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("EXCUTESTANDARD", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("TESTRESULT", objs[20]==null?"":objs[20].toString());	
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取泄漏检测检测点信息
	public void getXieloujiancejiancedian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPENAME,PIPELINENO,EXCUTESTARDARD,TESTDATE," +
				"TESTTIME,TESTUNIT,TESTER,DEVICEMODEL,DEVICENO,SENSITIVITY," +
				"LOCATIONY,LOCATIONX,HEIGHT,ALARMLOWER,LEAKCONCENTRATION," +
				"TESTRESULT,REMARK,LONGITUDE,LATITUDE,ELLIPSEH,PHOTONAME " +
				"from  PTEM_LEAK_TEST";
		sql+=" where id='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPENAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPELINENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("EXCUTESTARDARD", objs[3]==null?"":objs[3].toString());
		jsonobj.put("TESTDATE", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TESTTIME", objs[5]==null?"":objs[5].toString());
		jsonobj.put("TESTUNIT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("TESTER", objs[7]==null?"":objs[7].toString());
		jsonobj.put("DEVICEMODEL", objs[8]==null?"":objs[8].toString());
		jsonobj.put("DEVICENO", objs[9]==null?"":objs[9].toString());
		jsonobj.put("SENSITIVITY", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONY", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LOCATIONX", objs[12]==null?"":objs[12].toString());
		jsonobj.put("HEIGHT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ALARMLOWER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LEAKCONCENTRATION", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTRESULT", objs[16]==null?"":objs[16].toString());
		jsonobj.put("REMARK", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("LONGITUDE", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("LATITUDE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("ELLIPSEH", objs[20]==null?"":objs[20].toString());
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取泄漏检测泄漏点信息
	public void getXieloujiancexieloudian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPENAME,PIPELINENO,EXCUTESTARDARD,TESTDATE," +
				"TESTTIME,TESTUNIT,TESTER,DEVICEMODEL,DEVICENO,SENSITIVITY," +
				"LOCATIONY,LOCATIONX,HEIGHT,ALARMLOWER,LEAKCONCENTRATION," +
				"TESTRESULT,REMARK,LONGITUDE,LATITUDE,ELLIPSEH,PHOTONAME " +
				"from  PTEM_LEAK_TEST";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPENAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPELINENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("EXCUTESTARDARD", objs[3]==null?"":objs[3].toString());
		jsonobj.put("TESTDATE", objs[4]==null?"":objs[4].toString());
		jsonobj.put("TESTTIME", objs[5]==null?"":objs[5].toString());
		jsonobj.put("TESTUNIT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("TESTER", objs[7]==null?"":objs[7].toString());
		jsonobj.put("DEVICEMODEL", objs[8]==null?"":objs[8].toString());
		jsonobj.put("DEVICENO", objs[9]==null?"":objs[9].toString());
		jsonobj.put("SENSITIVITY", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LOCATIONY", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LOCATIONX", objs[12]==null?"":objs[12].toString());
		jsonobj.put("HEIGHT", objs[13]==null?"":objs[13].toString());
		jsonobj.put("ALARMLOWER", objs[14]==null?"":objs[14].toString());
		jsonobj.put("LEAKCONCENTRATION", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTRESULT", objs[16]==null?"":objs[16].toString());
		jsonobj.put("REMARK", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("LONGITUDE", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("LATITUDE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("ELLIPSEH", objs[20]==null?"":objs[20].toString());
		String codeid=objs[21]==null?"":objs[21].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取土壤腐蚀性检测信息
	public void getTurangfushixing() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,PIPENAME,PIPELINENO,PIPENO,TESTPOINTNO," +
				"TESTPOINTDESCRIPTION,EXCUTESTANDARD,LOCATIONY,LOCATIONX," +
				"HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH,TESTDATE,TESTUNIT," +
				"TESTER,DEVICENAMEMODEL,DEVICENO,PIPEDEPTH,POLEDISTANCE," +
				"SHOWVALUE,SOILRESISTIVITY,SOILCORROSIONEVALUATE,SOILTEXTURE," +
				"TESTMETHOD,CORROSIONPOTENTIAL,REDOXPOTENTIAL,PHVALUE," +
				"MOISTURECONTENT,SALTCONTENT,C1CONTENT,CURRENTDENSITY," +
				"SOILCORROSIONLEVEL,REMARK,PHOTO from  PTEM_SOILCORROSION";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPENAME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPELINENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("PIPENO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("TESTPOINTNO", objs[4]==null?"":objs[4].toString());
		
		jsonobj.put("TESTPOINTDESCRIPTION", objs[5]==null?"":objs[5].toString());
		jsonobj.put("EXCUTESTANDARD", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LOCATIONY", objs[7]==null?"":objs[7].toString());
		jsonobj.put("LOCATIONX", objs[8]==null?"":objs[8].toString());
		
		jsonobj.put("HEIGHT", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LONGITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LATITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ELLIPSEH", objs[12]==null?"":objs[12].toString());
		jsonobj.put("TESTDATE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("TESTUNIT", objs[14]==null?"":objs[14].toString());
		
		jsonobj.put("TESTER", objs[15]==null?"":objs[15].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[16]==null?"":objs[16].toString());
		jsonobj.put("DEVICENO", objs[17]==null?"":objs[17].toString());
		jsonobj.put("PIPEDEPTH", objs[18]==null?"":objs[18].toString());
		jsonobj.put("POLEDISTANCE", objs[19]==null?"":objs[19].toString());
		
		jsonobj.put("SHOWVALUE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("SOILRESISTIVITY", objs[21]==null?"":objs[21].toString());
		jsonobj.put("SOILCORROSIONEVALUATE", objs[22]==null?"":objs[22].toString());	
		jsonobj.put("SOILTEXTURE", objs[23]==null?"":objs[23].toString());	
		
		jsonobj.put("TESTMETHOD", objs[24]==null?"":objs[24].toString());	
		jsonobj.put("CORROSIONPOTENTIAL", objs[25]==null?"":objs[25].toString());	
		jsonobj.put("REDOXPOTENTIAL", objs[26]==null?"":objs[26].toString());	
		jsonobj.put("PHVALUE", objs[27]==null?"":objs[27].toString());
		
		jsonobj.put("MOISTURECONTENT", objs[28]==null?"":objs[28].toString());
		jsonobj.put("SALTCONTENT", objs[29]==null?"":objs[29].toString());
		jsonobj.put("C1CONTENT", objs[30]==null?"":objs[30].toString());
		jsonobj.put("CURRENTDENSITY", objs[31]==null?"":objs[31].toString());
		
		jsonobj.put("SOILCORROSIONLEVEL", objs[32]==null?"":objs[32].toString());
		jsonobj.put("REMARK", objs[33]==null?"":objs[33].toString());
		
		String codeid=objs[34]==null?"":objs[34].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取杂散电流检测信息	
	public void getZasandianliujiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select t1.TASKNO,t1.GROUNDSTATUS,t1.TESTDATE," +
				"t1.STRAYPOINTDESCRIPTION,t1.LOCATIONY,t1.LOCATIONX," +
				"t1.TESTUNIT,t1.TESTER,t1.DEVICENAMEMODEL,t1.DEVICENO," +
				"t1.REFERENCETYPE,t1.MONITORDURATION,t1.DAQINTERVAL," +
				"t1.EVALUATIONLEVEL,t1.EXCUTESTANDARD,t1.DISTURBTYPE," +
				"t1.TESTMETHOD,t1.PIPENAME,t1.PIPELINENO,t1.PIPENO," +
				"t1.COATINGTYPE,t1.CPWAY,t1.STRAYPOINTNO," +
				"t1.HEIGHT,t1.LONGITUDE,t1.LATITUDE,t1.ELLIPSEH," +
				"t1.POTENTIALDIAGRAM,t1.ATTACHMENT,t1.PHOTO,t1.REMARK " +
				"from PTEM_STRAYCURRENTTEST t1";
		sql+=" where t1.ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("GROUNDSTATUS", objs[1]==null?"":objs[1].toString());
		jsonobj.put("TESTDATE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("STRAYPOINTDESCRIPTION", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONY", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONX", objs[5]==null?"":objs[5].toString());
		jsonobj.put("TESTUNIT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("TESTER", objs[7]==null?"":objs[7].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[8]==null?"":objs[8].toString());
		jsonobj.put("DEVICENO", objs[9]==null?"":objs[9].toString());
		jsonobj.put("REFERENCETYPE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("MONITORDURATION", objs[11]==null?"":objs[11].toString());
		jsonobj.put("DAQINTERVAL", objs[12]==null?"":objs[12].toString());
		jsonobj.put("EVALUATIONLEVEL", objs[13]==null?"":objs[13].toString());
		jsonobj.put("EXCUTESTANDARD", objs[14]==null?"":objs[14].toString());
		jsonobj.put("DISTURBTYPE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("TESTMETHOD", objs[16]==null?"":objs[16].toString());
		jsonobj.put("PIPENAME", objs[17]==null?"":objs[17].toString());
		jsonobj.put("PIPELINENO", objs[18]==null?"":objs[18].toString());
		jsonobj.put("PIPENO", objs[19]==null?"":objs[19].toString());
		jsonobj.put("COATINGTYPE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("CPWAY", objs[21]==null?"":objs[21].toString());
		jsonobj.put("STRAYPOINTNO", objs[22]==null?"":objs[22].toString());
		jsonobj.put("HEIGHT", objs[23]==null?"":objs[23].toString());
		jsonobj.put("LONGITUDE", objs[24]==null?"":objs[24].toString());
		jsonobj.put("LATITUDE", objs[25]==null?"":objs[25].toString());
		jsonobj.put("ELLIPSEH", objs[26]==null?"":objs[26].toString());
		jsonobj.put("POTENTIALDIAGRAM", objs[27]==null?"":objs[27].toString());
		String codeid=objs[28]==null?"":objs[28].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
		codeid=objs[29]==null?"":objs[29].toString();
		filepath=getfilepath(codeid);
		filename=getfilename(filepath);
		jsonobj.put("photopath",filepath);
		jsonobj.put("photoname",filename);
		jsonobj.put("REMARK", objs[30]==null?"":objs[30].toString());
		out.print(jsonobj.toString());
	}
	//获取防腐层检测点信息
	public void getFangfucengjiancedian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		//任务编号 管线编号 管网编号 坐标（坐标Y；坐标X；高程） 经纬度（经度L；纬度B；椭球高）
		//检测序号 距离 埋深 PCM电流 定位电流 绝缘电阻值 评价结果 信号接入点 接入点坐标（坐标Y；坐标X；高程）
		//接入点经纬度（经度L；纬度B；椭球高） 初始电流 检测单位 检测日期 备注
		String sql="select t1.TASKNO,t1.PIPELINENO,t1.PIPENO," +
				"t1.DATALOCATIONY,t1.DATALOCATIONX,t1.DATAHEIGHT," +
				"t1.LONGITUDE,t1.LATITUDE,ELLIPSEH,t1.DISTANCE,t1.DEPTH," +
				"t1.PCMCURRENT,t1.LOCATIONCURRENT,t1.RISOVALUE,t1.EVALUATIONRESULT," +
				"t2.SIGNALACCESSPOINT,t2.LOCATIONY,t2.LOCATIONX,t2.ACCESSHEIGHT," +
				"t2.ACCESSLONGITUDE,t2.ACCESSLATITUDE,t2.ACCESSELLIPSEH," +
				"t2.INITIALCURRENT,t2.TESTUNIT,t2.TESTDATE,t2.REMARK,t1.DATASERIALNO " +
				"from PTEM_RISOTEST_PCM_TESTDATA t1,PTEM_RISOTEST_PCM t2 " +
				"where t1.PARENTID=t2.ID and ";
		sql+=" t1.ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("PIPELINENO", objs[1]==null?"":objs[1].toString());
		jsonobj.put("PIPENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("DATALOCATIONY", objs[3]==null?"":objs[3].toString());
		jsonobj.put("DATALOCATIONX", objs[4]==null?"":objs[4].toString());
		jsonobj.put("DATAHEIGHT", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LONGITUDE", objs[6]==null?"":objs[6].toString());
		jsonobj.put("LATITUDE", objs[7]==null?"":objs[7].toString());
		jsonobj.put("ELLIPSEH", objs[8]==null?"":objs[8].toString());
		jsonobj.put("DISTANCE", objs[9]==null?"":objs[9].toString());
		jsonobj.put("DEPTH", objs[10]==null?"":objs[10].toString());
		jsonobj.put("PCMCURRENT", objs[11]==null?"":objs[11].toString());
		jsonobj.put("LOCATIONCURRENT", objs[12]==null?"":objs[12].toString());
		jsonobj.put("RISOVALUE", objs[13]==null?"":objs[13].toString());
		jsonobj.put("EVALUATIONRESULT", objs[14]==null?"":objs[14].toString());
		jsonobj.put("SIGNALACCESSPOINT", objs[15]==null?"":objs[15].toString());
		jsonobj.put("LOCATIONY", objs[16]==null?"":objs[16].toString());
		jsonobj.put("LOCATIONX", objs[17]==null?"":objs[17].toString());
		jsonobj.put("ACCESSHEIGHT", objs[18]==null?"":objs[18].toString());
		jsonobj.put("ACCESSLONGITUDE", objs[19]==null?"":objs[19].toString());
		jsonobj.put("ACCESSLATITUDE", objs[20]==null?"":objs[20].toString());
		jsonobj.put("ACCESSELLIPSEH", objs[21]==null?"":objs[21].toString());
		jsonobj.put("INITIALCURRENT", objs[22]==null?"":objs[22].toString());
		jsonobj.put("TESTUNIT", objs[23]==null?"":objs[23].toString());
		jsonobj.put("TESTDATE", objs[24]==null?"":objs[24].toString());
		jsonobj.put("REMARK", objs[25]==null?"":objs[25].toString());
		jsonobj.put("DATASERIALNO", objs[26]==null?"":objs[26].toString());
		
//		String codeid=objs[17]==null?"":objs[17].toString();
//		String filepath=getfilepath(codeid);
//		String filename=getfilename(filepath);
//		jsonobj.put("attachmentpath",filepath);
//		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取防腐层破损点信息
	public void getFangfucengposundian() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,TESTDATE,DAMAGEPOINTNO,LOCATIONDESCRIPTION," +
				"LOCATIONY,LOCATIONX,TESTUNIT,JUDGMENTBASIS,GROUNDTYPE," +
				"REMARK,LONGITUDE,LATITUDE,PIPELINENO,PIPENO,HEIGHT,ELLIPSEH," +
				"PHOTO from PTEM_COATING_DAMAGEDPOINT";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("TESTDATE", objs[1]==null?"":objs[1].toString());
		jsonobj.put("DAMAGEPOINTNO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONY", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONX", objs[5]==null?"":objs[5].toString());
		jsonobj.put("TESTUNIT", objs[6]==null?"":objs[6].toString());
		jsonobj.put("JUDGMENTBASIS", objs[7]==null?"":objs[7].toString());
		jsonobj.put("GROUNDTYPE", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REMARK", objs[9]==null?"":objs[9].toString());
		jsonobj.put("LONGITUDE", objs[10]==null?"":objs[10].toString());
		jsonobj.put("LATITUDE", objs[11]==null?"":objs[11].toString());
		jsonobj.put("PIPELINENO", objs[12]==null?"":objs[12].toString());
		jsonobj.put("PIPENO", objs[13]==null?"":objs[13].toString());
		jsonobj.put("HEIGHT", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ELLIPSEH", objs[15]==null?"":objs[15].toString());	
		String codeid=objs[16]==null?"":objs[16].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	
	//获取测试桩检测信息
	public void getCeshizhuangjiance() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select TASKNO,TESTDATE,TESTPILENO,DEVICENO," +
				"LOCATIONDESCRIPTION,LOCATIONY,LOCATIONX,TESTUNIT," +
				"TESTER,CURRENTSITUATION,PROTECTPOTENTIAL,ANODEPROTENTIAL," +
				"ANODECURRENT,ANODERESISTOR,EVALUATELEVEL,PHOTONAMES,REMARK," +
				"DEVICENAMEMODEL,EXCUTESTANDARD,TESTMETHOD,PIPENAME,PIPELINENO," +
				"PIPENO,HEIGHT,LONGITUDE,LATITUDE,ELLIPSEH " +
				"from  PTEM_TESTPILEINSPECT";
		sql+=" where ID='"+id+"'";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("TESTDATE", objs[1]==null?"":objs[1].toString());
		jsonobj.put("TESTPILENO", objs[2]==null?"":objs[2].toString());
		jsonobj.put("DEVICENO", objs[3]==null?"":objs[3].toString());
		jsonobj.put("LOCATIONDESCRIPTION", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONY", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONX", objs[6]==null?"":objs[6].toString());
		jsonobj.put("TESTUNIT", objs[7]==null?"":objs[7].toString());
		jsonobj.put("TESTER", objs[8]==null?"":objs[8].toString());
		jsonobj.put("CURRENTSITUATION", objs[9]==null?"":objs[9].toString());
		jsonobj.put("PROTECTPOTENTIAL", objs[10]==null?"":objs[10].toString());
		jsonobj.put("ANODEPROTENTIAL", objs[11]==null?"":objs[11].toString());
		jsonobj.put("ANODECURRENT", objs[12]==null?"":objs[12].toString());
		jsonobj.put("ANODERESISTOR", objs[13]==null?"":objs[13].toString());
		jsonobj.put("EVALUATELEVEL", objs[14]==null?"":objs[14].toString());
		//jsonobj.put("PHOTONAMES", objs[15]==null?"":objs[15].toString());
		jsonobj.put("REMARK", objs[16]==null?"":objs[16].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[17]==null?"":objs[17].toString());
		jsonobj.put("EXCUTESTANDARD", objs[18]==null?"":objs[18].toString());
		jsonobj.put("TESTMETHOD", objs[19]==null?"":objs[19].toString());
		jsonobj.put("PIPENAME", objs[20]==null?"":objs[20].toString());
		jsonobj.put("PIPELINENO", objs[21]==null?"":objs[21].toString());
		jsonobj.put("PIPENO", objs[22]==null?"":objs[22].toString());
		jsonobj.put("HEIGHT", objs[23]==null?"":objs[23].toString());
		jsonobj.put("LONGITUDE", objs[24]==null?"":objs[24].toString());
		jsonobj.put("LATITUDE", objs[25]==null?"":objs[25].toString());
		jsonobj.put("ELLIPSEH", objs[26]==null?"":objs[26].toString());
		String codeid=objs[15]==null?"":objs[15].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	//获取阴极保护密间隔检测点信息	
	public void getYinjibaohumijiange() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数			
		String id = getRequest().getParameter("id");
		String sql="select t1.TASKNO,t1.TESTTIME,t1.CONNECTMODE,t1.TESTUNIT," +
				"t1.TESTER,t1.LOCATIONY,t1.LOCATIONX,t1.STARTPOINTPOTENTIAL," +
				"t1.TESTMETHOD,t1.REFERENCETYPE,t1.DATADIAGRAM,t1.DEVICENAMEMODEL," +
				"t1.DEVICENO,t1.EXCUTESTANDARD,t1.REMARK,t1.ACCESSLONGITUDE," +
				"t1.ACCESSLATITUDE,t2.RECORDNUMBER,t2.DISTANCE,t2.PULSE,t2.CIPS_ON," +
				"t2.CIPS_OFF,t2.DCVG_ON,t2.DCVG_OFF,t2.LATUTIDE,t2.NS,t2.LONGITUDE," +
				"t2.EW,t2.ALTITUDE,t2.DATE_TIME,t2.FEATURE,t2.TESTRESULT,t2.SECTIONNO," +
				"t2.PIPENO,t2.PIPELINENO,t2.POTENTIALRANGE,t2.PROTECTRATE," +
				"t2.DATAY,t2.DATAX,t2.HEIGHT from PTEM_CIPS_TEST t1,PTEM_CIPS_TEST_DATA t2";
		sql+=" where t2.ID='"+id+"'";
		sql+=" and t2.PARENTID=t1.id ";
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])list.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("TASKNO", objs[0]==null?"":objs[0].toString());
		jsonobj.put("TESTTIME", objs[1]==null?"":objs[1].toString());
		jsonobj.put("CONNECTMODE", objs[2]==null?"":objs[2].toString());
		jsonobj.put("TESTUNIT", objs[3]==null?"":objs[3].toString());
		jsonobj.put("TESTER", objs[4]==null?"":objs[4].toString());
		jsonobj.put("LOCATIONY", objs[5]==null?"":objs[5].toString());
		jsonobj.put("LOCATIONX", objs[6]==null?"":objs[6].toString());
		jsonobj.put("STARTPOINTPOTENTIAL", objs[7]==null?"":objs[7].toString());
		jsonobj.put("TESTMETHOD", objs[8]==null?"":objs[8].toString());
		jsonobj.put("REFERENCETYPE", objs[9]==null?"":objs[9].toString());
		//jsonobj.put("DATADIAGRAM", objs[10]==null?"":objs[10].toString());
		jsonobj.put("DEVICENAMEMODEL", objs[11]==null?"":objs[11].toString());
		jsonobj.put("DEVICENO", objs[12]==null?"":objs[12].toString());
		jsonobj.put("EXCUTESTANDARD", objs[13]==null?"":objs[13].toString());
		jsonobj.put("REMARK", objs[14]==null?"":objs[14].toString());
		jsonobj.put("ACCESSLONGITUDE", objs[15]==null?"":objs[15].toString());
		jsonobj.put("ACCESSLATITUDE", objs[16]==null?"":objs[16].toString());
		jsonobj.put("RECORDNUMBER", objs[17]==null?"":objs[17].toString());	
		jsonobj.put("DISTANCE", objs[18]==null?"":objs[18].toString());	
		jsonobj.put("PULSE", objs[19]==null?"":objs[19].toString());	
		jsonobj.put("CIPS_ON", objs[20]==null?"":objs[20].toString());	
		jsonobj.put("CIPS_OFF", objs[21]==null?"":objs[21].toString());	
		jsonobj.put("DCVG_ON", objs[22]==null?"":objs[22].toString());	
		jsonobj.put("DCVG_OFF", objs[23]==null?"":objs[23].toString());	
		jsonobj.put("LATUTIDE", objs[24]==null?"":objs[24].toString());
		jsonobj.put("NS", objs[25]==null?"":objs[25].toString());
		jsonobj.put("LONGITUDE", objs[26]==null?"":objs[26].toString());
		jsonobj.put("EW", objs[27]==null?"":objs[27].toString());
		jsonobj.put("ALTITUDE", objs[28]==null?"":objs[28].toString());
		jsonobj.put("DATE_TIME", objs[29]==null?"":objs[29].toString());
		jsonobj.put("FEATURE", objs[30]==null?"":objs[30].toString());
		jsonobj.put("TESTRESULT", objs[31]==null?"":objs[31].toString());
		jsonobj.put("SECTIONNO", objs[32]==null?"":objs[32].toString());
		jsonobj.put("PIPENO", objs[33]==null?"":objs[33].toString());
		jsonobj.put("PIPELINENO", objs[34]==null?"":objs[34].toString());
		jsonobj.put("POTENTIALRANGE", objs[35]==null?"":objs[35].toString());
		jsonobj.put("PROTECTRATE", objs[36]==null?"":objs[36].toString());
		jsonobj.put("DATAY", objs[37]==null?"":objs[37].toString());
		jsonobj.put("DATAX", objs[38]==null?"":objs[38].toString());
		jsonobj.put("HEIGHT", objs[39]==null?"":objs[39].toString());
		String codeid=objs[10]==null?"":objs[10].toString();
		String filepath=getfilepath(codeid);
		String filename=getfilename(filepath);
		jsonobj.put("attachmentpath",filepath);
		jsonobj.put("attachmentname",filename);
//		codeid=objs[18]==null?"":objs[18].toString();
//		filepath=getfilepath(codeid);
//		filename=getfilename(filepath);
//		jsonobj.put("photopath",filepath);
//		jsonobj.put("photoname",filename);
		out.print(jsonobj.toString());
	}
	public void getPoint(String datatablename) throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数
		String type=getRequest().getParameter("type");
		String id = getRequest().getParameter("id");
		String old=type;
		if(id.indexOf("Root")!=-1)
		{
			old=type+"Root";			
		}
		id=id.replace(old, "");
		//String id = getRequest().getParameter("id").replace(type, "");		
		String tablename=getRequest().getParameter("tablename");
		String fieldname=getRequest().getParameter("fieldname");
		String longitudeField=getRequest().getParameter("longitudeField");
		String latitudeField=getRequest().getParameter("latitudeField");
		if(longitudeField==null)
		{
			//longitudeField="LONGITUDE";
			longitudeField="LONGITUDE_map";
		}
		if(latitudeField==null)
		{
			//latitudeField="LATITUDE";
			latitudeField="LATITUDE_map";
		}
		//查询坐标
		String strSql = "select t1.";
		strSql+=longitudeField;
		strSql+=",t1.";
		strSql+=latitudeField;
		if(datatablename.equals("ptem_risotest_pcm_testdata"))
		{
			strSql+=",t1.EVALUATIONRESULT";
		}
		else if(datatablename.equals("ptem_cips_test_data"))
		{
			strSql+=",t1.TESTRESULT";
		}
		strSql+=" from ";
		strSql+=tablename;
		strSql+=" t1 where t1.";
		strSql+=fieldname;
		strSql+="='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		Object[] objs = (Object[])lists.get(0);
		if(objs[2]!=null)
		{
			type=objs[2].toString();
		}		
		//查询图片
		String sql="";		
		sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
		sql+=type;
		sql+="'";			
		List list = dbService.queryDataBySql(sql);
		//输出		
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
		jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
		out.print(jsonobj.toString());
	}
	public void getPoint() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		//获取页面传入的参数
		String type=getRequest().getParameter("type");
		String id = getRequest().getParameter("id");
		String old=type;
		if(id.indexOf("Root")!=-1)
		{
			old=type+"Root";			
		}
		id=id.replace(old, "");
		//String id = getRequest().getParameter("id").replace(type, "");		
		String tablename=getRequest().getParameter("tablename");
		if(tablename.equals("ptem_risotest_pcm_testdata"))
		{
			getPoint("ptem_risotest_pcm_testdata");
			return;
		}
		if(tablename.equals("ptem_cips_test_data"))
		{
			getPoint("ptem_cips_test_data");
			return;
		}
		String fieldname=getRequest().getParameter("fieldname");
		String longitudeField=getRequest().getParameter("longitudeField");
		String latitudeField=getRequest().getParameter("latitudeField");
		if(longitudeField==null)
		{
			//longitudeField="LONGITUDE";
			longitudeField="LONGITUDE_map";
		}
		if(latitudeField==null)
		{
			//latitudeField="LATITUDE";
			latitudeField="LATITUDE_map";
		}
		//查询坐标
		String strSql = "select t1.";
		strSql+=longitudeField;
		strSql+=",t1.";
		strSql+=latitudeField;
		strSql+=" from ";
		strSql+=tablename;
		strSql+=" t1 where t1.";
		strSql+=fieldname;
		strSql+="='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		//查询图片
		String sql="";		
		sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
		sql+=type;
		sql+="'";		
		List list = dbService.queryDataBySql(sql);
		//输出
		Object[] objs = (Object[])lists.get(0);
		JSONObject jsonobj = new JSONObject();
		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
		jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
		out.print(jsonobj.toString());
	}
	
//	public void getPoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		//获取页面传入的参数
//		String type=getRequest().getParameter("type");
//		String id = getRequest().getParameter("id").replace(type, "");		
//		String tablename=getRequest().getParameter("tablename");
//		String fieldname=getRequest().getParameter("fieldname");
//		//查询坐标
//		String strSql = "select t1.LONGITUDE,t1.LATITUDE from ";
//		strSql+=tablename;
//		strSql+=" t1 where t1.";
//		strSql+=fieldname;
//		strSql+="='"+id+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		//查询图片
//		String sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
//		sql+=type;
//		sql+="'";
//		List list = dbService.queryDataBySql(sql);
//		//输出
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
//		out.print(jsonobj.toString());
//	}
	
	public void getPointAll(String datatablename) throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		//获取页面传入的参数
		String type=getRequest().getParameter("type");
		String typeRoot=type+"Root";
		String id = getRequest().getParameter("id").replace(typeRoot, "");		
		String tablename=getRequest().getParameter("tablename");	
		String fieldname=getRequest().getParameter("fieldname");
		String longitudeField=getRequest().getParameter("longitudeField");
		String latitudeField=getRequest().getParameter("latitudeField");
		if(longitudeField==null)
		{
			//longitudeField="LONGITUDE";
			longitudeField="LONGITUDE_map";
		}
		if(latitudeField==null)
		{
			//latitudeField="LATITUDE";
			latitudeField="LATITUDE_map";
		}
		//查询坐标
		String strSql = "select t1.";
		strSql+=longitudeField;
		strSql+=",t1.";
		strSql+=latitudeField;
		if(datatablename.equals("ptem_risotest_pcm_testdata"))
		{
			strSql+=",t1.EVALUATIONRESULT";
		}
		else if(datatablename.equals("ptem_cips_test_data"))
		{
			strSql+=",t1.TESTRESULT";
		}
		strSql+=" from ";
		strSql+=tablename;
		strSql+=" t1 where t1.pipelineno";
		//strSql+=fieldname;
		strSql+="='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);		
		//输出
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if(objs[2]!=null)
			{
				type=objs[2].toString();
			}		
			//查询图片
			String sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
			sql+=type;
			sql+="'";
			List list = dbService.queryDataBySql(sql);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
				jsonArray.add(jsonobj);
			}
			else{
				continue;
			}
		}
		out.print(jsonArray.toString());
	}
	public void getPointAll() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		//获取页面传入的参数
		String type=getRequest().getParameter("type");
		String typeRoot=type+"Root";
		String id = getRequest().getParameter("id").replace(typeRoot, "");		
		String tablename=getRequest().getParameter("tablename");
		if(tablename.equals("ptem_risotest_pcm_testdata"))
		{
			getPointAll("ptem_risotest_pcm_testdata");
			return;
		}
		if(tablename.equals("ptem_cips_test_data"))
		{
			getPointAll("ptem_cips_test_data");
			return;
		}
		String fieldname=getRequest().getParameter("fieldname");
		String longitudeField=getRequest().getParameter("longitudeField");
		String latitudeField=getRequest().getParameter("latitudeField");
		if(longitudeField==null)
		{
			//longitudeField="LONGITUDE";
			longitudeField="LONGITUDE_map";
		}
		if(latitudeField==null)
		{
			//latitudeField="LATITUDE";
			latitudeField="LATITUDE_map";
		}
		//查询坐标
		String strSql = "select t1.";
		strSql+=longitudeField;
		strSql+=",t1.";
		strSql+=latitudeField;
		strSql+=" from ";
		strSql+=tablename;
		strSql+=" t1 where t1.pipelineno";
		//strSql+=fieldname;
		strSql+="='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		//查询图片
		String sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
		sql+=type;
		sql+="'";
		List list = dbService.queryDataBySql(sql);
		//输出
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
				jsonArray.add(jsonobj);
			}
			else{
				continue;
			}
		}
		out.print(jsonArray.toString());
	}
	//查询一个管线下所有违章占压坐标
	public void getWeizhangzhanyaPointAll() throws IOException{
		PrintWriter out=PubMethod.GetPrintWriter();
		JSONArray jsonArray = new JSONArray();
		String id = getRequest().getParameter("id").replace("wzzyRoot", "");
		String strSql = "select t1.LOCATIONL,t1.LOCATIONB from PTEM_VIOLATION t1 " +
			" where t1.pipelineno='"+id+"'";
		List lists = dbService.queryDataBySql(strSql);
		int num=lists.size();
		for(int i=0;i<num;i++){
			Object[] objs = (Object[])lists.get(i);
			if (objs[0]!=null&&!objs[0].toString().equals("")){
				JSONObject jsonobj = new JSONObject();
				jsonobj.put("longitude", objs[0].toString());
				jsonobj.put("latitude", objs[1].toString());
				jsonArray.add(jsonobj);
			}
			else{
				continue;
			}
		}
		out.print(jsonArray.toString());
	}
//	//查询违章占压坐标
//	public void getWeizhangzhanyaPoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		String id = getRequest().getParameter("id").replace("wzzy", "");
//		String strSql = "select t1.LOCATIONL,t1.LOCATIONB from PTEM_VIOLATION t1 " +
//			" where t1.VIOLATIONNO='"+id+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		//jsonobj.put("picfilename", objs[2]==null?"":objs[2].toString());
//		out.print(jsonobj.toString());
//	}
	//查询三通坐标
//	public void getTeePoint() throws IOException{
//		PrintWriter out=PubMethod.GetPrintWriter();
//		String type="pointTee";
//		String id = getRequest().getParameter("id").replace(type, "");
//		String strSql = "select t1.LONGITUDE,t1.LATITUDE from ptem_point_tee t1 " +
//			" where t1.teeno='"+id+"'";
//		List lists = dbService.queryDataBySql(strSql);
//		Object[] objs = (Object[])lists.get(0);
//		JSONObject jsonobj = new JSONObject();
//		jsonobj.put("longitude", objs[0]==null?"":objs[0].toString());
//		jsonobj.put("latitude", objs[1]==null?"":objs[1].toString());
//		String sql="select t.picfilename from ptem_pipepoint_pic t where t.pointtype='";		
//		sql+=type;
//		sql+="'";
//		List list = dbService.queryDataBySql(sql);
//		jsonobj.put("picfilename", list.get(0)==null?"":list.get(0).toString());
//		out.print(jsonobj.toString());
//	}
//	
	//查询测试桩列表
	public void queryPointPoleList(){
		try{
			String tzid = getRequest().getParameter("tzid");
			//去掉root
			tzid=tzid.substring(4);
			Map<String,String> filterMap=getPagerMap();
			if(null!=tzid && !"".equals(tzid)){
				filterMap.put("tzid", tzid);
			}
			PageResult result= pipePointService.queryPointPoleList(filterMap);
			String[] viewArray={
					"ID","POLENO","DEVICECODE","PROJECTNO","LOCATIONY",
					"LOCATIONX","HEIGHT","LONGITUDE","LATITUDE","ELLIPSEH",
					"LOCATIONDESCRIPTION","REMOTEEQUIPMENT","MANAGEUNIT",
					"MANAGEDEPARTMENT","BUILDER","USETIME",
					"POTENTIAL","PIPELINENO","PIPESECTIONNO",
					"REMARK","ATTACHMENT","POLETYPE","PHOTO",
					"SIGNEDUNIT","SIGNED"}
			;
			String str=getColumnJson(result,viewArray);
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setContentType("application/XML,charset=GBK");
			response.setHeader("Charset", "GBK");
			response.setCharacterEncoding("GBK");
			response.setContentType("text/xml");
			PrintWriter out = getResponse().getWriter();
			out.print(str);
			}
			catch (Exception e) {
				e.printStackTrace();
			}
	}
	
	//查询违章占压列表
	public void queryWeizhangzhanyaList(){
		try{
			String tzid = getRequest().getParameter("tzid");
			//去掉root
			tzid=tzid.substring(4);
			Map<String,String> filterMap=getPagerMap();
			if(null!=tzid && !"".equals(tzid)){
				filterMap.put("tzid", tzid);
			}
			PageResult result= pipePointService.queryWeizhangzhanyaList(filterMap);
			String[] viewArray={
					"ID","VIOLATIONNO","VIOLATOR","OCCURTIME","VIOLATIONFORM","NATURE",
					"ISSEDIMENTATION","LOCATIONDESCRIPTION","LOCATIONY","LOCATIONX",
					"LOCATIONH","LOCATIONL","LOCATIONB","LOCATIONELLIPSEH",
					"PIPELINELENGTH","DISTANCE","STATE","SAFETYLEVEL","PHOTO","PIPELINENO",
					"PIPESECTIONNO","REMARK","SIGNEDUNIT","SIGNED"}
			;
			String str=getColumnJson(result,viewArray);
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setContentType("application/XML,charset=GBK");
			response.setHeader("Charset", "GBK");
			response.setCharacterEncoding("GBK");
			response.setContentType("text/xml");
			PrintWriter out = getResponse().getWriter();
			out.print(str);
			}
			catch (Exception e) {
				e.printStackTrace();
			}
	}
	
	//查询导波检测列表
	public void queryDaobojianceList(){
		try{
			String tzid = getRequest().getParameter("tzid");
			//去掉root
			tzid=tzid.substring(4);
			Map<String,String> filterMap=getPagerMap();
			if(null!=tzid && !"".equals(tzid)){
				filterMap.put("tzid", tzid);
			}
			PageResult result= pipePointService.queryDaobojianceList(filterMap);
			String[] viewArray={
					"ID","TASKNO","PIPELINENO","PIPENO","LOCATIONNO",
					"LOCATIONDESCRIPTION","TYPE","OUTERDIAMETER","WALLTHICKNESS",
					"LOCATIONY","LOCATIONX","HEIGHT","LONGITUDE",
					"LATITUDE","ELLIPSEH","TESTDATE","TESTUNIT",
					"TESTER","DEVICENAMEMODEL","DEVICENO","PROBENO",
					"TESTMETHOD","SERIALNO","TESTRESULT","ATTACHMENT"}
			;
			String str=getColumnJson(result,viewArray);
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setContentType("application/XML,charset=GBK");
			response.setHeader("Charset", "GBK");
			response.setCharacterEncoding("GBK");
			response.setContentType("text/xml");
			PrintWriter out = getResponse().getWriter();
			out.print(str);
			}
			catch (Exception e) {
				e.printStackTrace();
			}
	}
	
}
